summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/native/macosx
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-01-23 02:17:13 +0100
committerSven Gothel <[email protected]>2019-01-23 02:17:13 +0100
commit025e4548e982954528a461637a02d07dc509530e (patch)
tree0aa849831dc3345a41ea8c9e0878aa3edb699705 /src/nativewindow/native/macosx
parentcc157b6a7dfbdefbbfc31085b4013e395cfecd13 (diff)
OSX/Newt: Catch NSRangeException on closing a window
rarely occurs on terminating or killing the process
Diffstat (limited to 'src/nativewindow/native/macosx')
-rw-r--r--src/nativewindow/native/macosx/OSXmisc.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nativewindow/native/macosx/OSXmisc.m b/src/nativewindow/native/macosx/OSXmisc.m
index 80ddee415..c04ba786e 100644
--- a/src/nativewindow/native/macosx/OSXmisc.m
+++ b/src/nativewindow/native/macosx/OSXmisc.m
@@ -383,8 +383,13 @@ JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_DestroyNSWindow0
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[CATransaction begin];
+NS_DURING
NSWindow* mWin = (NSWindow*) ((intptr_t) nsWindow);
[mWin close]; // performs release!
+NS_HANDLER
+ // On killing or terminating the process [NSWindow _close], rarely
+ // throws an NSRangeException while ordering out menu items
+NS_ENDHANDLER
[CATransaction commit];
[pool release];