소스 검색

[NSOpenGLContext update[ is prohibited outside the main thread

Emir Marincic 5 년 전
부모
커밋
5b3b55a181
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/video/cocoa/SDL_cocoaopengl.m

+ 1 - 1
src/video/cocoa/SDL_cocoaopengl.m

@@ -66,7 +66,7 @@
     int value = SDL_AtomicSet(&self->dirty, 0);
     int value = SDL_AtomicSet(&self->dirty, 0);
     if (value > 0) {
     if (value > 0) {
         /* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
         /* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
-        [super update];
+        [super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
     }
     }
 }
 }