From c5b8487e1bb387b2512501e40385669c4a79537d Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 1 Sep 2019 20:04:54 +0100 Subject: [PATCH] Create NSOpenGLContext synchronously This is consistent with all other code that runs on the main UI thread, and slightly easier to reason about. --- gl-natives/src/main/c/jaggl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gl-natives/src/main/c/jaggl.c b/gl-natives/src/main/c/jaggl.c index c8081f2..c8676e1 100644 --- a/gl-natives/src/main/c/jaggl.c +++ b/gl-natives/src/main/c/jaggl.c @@ -551,7 +551,7 @@ JNIEXPORT jboolean JNICALL Java_jaggl_context_createContext(JNIEnv *env, jclass CGLCreateContext(jaggl_pix, jaggl_onscreen_context, &jaggl_context); if (jaggl_context) { - dispatch_async(dispatch_get_main_queue(), ^{ + dispatch_sync(dispatch_get_main_queue(), ^{ jaggl_context_appkit = [[NSOpenGLContext alloc] initWithCGLContextObj:jaggl_context]; jaggl_context_appkit.view = jaggl_view; });