Commit 5b3b55a18129c66699c23bc4db5218025f1dc660

Emir Marincic 2020-03-20T11:52:18

[NSOpenGLContext update[ is prohibited outside the main thread

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m
index 75a63df..74e93ed 100644
--- a/src/video/cocoa/SDL_cocoaopengl.m
+++ b/src/video/cocoa/SDL_cocoaopengl.m
@@ -66,7 +66,7 @@
     int value = SDL_AtomicSet(&self->dirty, 0);
     if (value > 0) {
         /* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
-        [super update];
+        [super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
     }
 }