From 2dd78164a756691d23c14faf6eb466d182f23a3c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 13 Oct 2011 17:37:05 +0200 Subject: OSX: Avoid invoking JNI or performSelectorOnMainThread in JNI if already mainThread --- src/jogl/native/macosx/MacOSXWindowSystemInterface.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/jogl') diff --git a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m index 1eb3da96c..188d6d593 100644 --- a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m +++ b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m @@ -590,7 +590,7 @@ Bool deleteContext(void* nsJContext, Bool releaseOnMainThread) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; [nsContext clearDrawable]; - if(releaseOnMainThread) { + if(releaseOnMainThread && NO == [NSThread isMainThread]) { [nsContext performSelectorOnMainThread:@selector(release:) withObject:nil waitUntilDone:YES]; } else { // would hangs for ~10s for 1 of the shared context, set releaseOnMainThread=true ! -- cgit v1.2.3