src/video/cocoa/SDL_cocoaopengl.m
changeset 13673 be892626e1aa
parent 13647 c8f27a5e868e
child 13703 19c4516de68d
     1.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Wed Mar 25 09:38:45 2020 -0700
     1.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Thu Mar 26 13:42:56 2020 -0400
     1.3 @@ -66,7 +66,11 @@
     1.4      int value = SDL_AtomicSet(&self->dirty, 0);
     1.5      if (value > 0) {
     1.6          /* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
     1.7 -        [super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
     1.8 +        if ([NSThread isMainThread]) {
     1.9 +            [super update];
    1.10 +        } else {
    1.11 +            [super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
    1.12 +        }
    1.13      }
    1.14  }
    1.15