Present drawable null check (#2272)

This commit is contained in:
Alex Cristici
2024-04-17 00:05:48 +03:00
committed by GitHub
parent eaf92662b6
commit 1d4fdefd27

View File

@@ -79,7 +79,9 @@ public:
void swap() override {
id<CAMetalDrawable> currentDrawable = [mtlView currentDrawable];
[commandBuffer presentDrawable:currentDrawable];
if (currentDrawable) {
[commandBuffer presentDrawable:currentDrawable];
}
[commandBuffer commit];
// Un-comment for synchronous, which can help troubleshoot rendering problems,