aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/native/macosx/MacOSXWindowSystemInterface.m
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-13 17:37:05 +0200
committerSven Gothel <[email protected]>2011-10-13 17:37:05 +0200
commit2dd78164a756691d23c14faf6eb466d182f23a3c (patch)
tree62259915ac286900ea0789fc42b87075c749ac25 /src/jogl/native/macosx/MacOSXWindowSystemInterface.m
parentd186f6e945fd157b219231fb3861b3b0ce10ee75 (diff)
OSX: Avoid invoking JNI or performSelectorOnMainThread in JNI if already mainThread
Diffstat (limited to 'src/jogl/native/macosx/MacOSXWindowSystemInterface.m')
-rw-r--r--src/jogl/native/macosx/MacOSXWindowSystemInterface.m2
1 files changed, 1 insertions, 1 deletions
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 !