Skip to content

Commit

Permalink
cocoa: Just update the OpenGL context directly if on the main thread.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 26, 2020
1 parent 9354aea commit f2ff953
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video/cocoa/SDL_cocoaopengl.m
Expand Up @@ -66,7 +66,11 @@ - (void)updateIfNeeded
int value = SDL_AtomicSet(&self->dirty, 0);
if (value > 0) {
/* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
[super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
if ([NSThread isMainThread]) {
[super update];
} else {
[super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
}
}
}

Expand Down

0 comments on commit f2ff953

Please sign in to comment.