summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-01-22 03:14:21 +0100
committerSven Gothel <[email protected]>2023-01-22 03:14:21 +0100
commit1711008b95534d1bf3c87570990253c0fa7cd9f6 (patch)
treeb86980a6df8707387439650120edf7a5b5526523 /src/nativewindow/classes
parent9829550f5bcb586f94f98f6d3c39f4d78fd78f3b (diff)
MacOS: JAWTWindow: Complete MacOS 12+ SIGSEGV JAW Crash Fix; This: Destroy NSWindow on MacOS main-thread
Destroy NSWindow on MacOS main-thread, avoiding spurious more rare SIGSEGV on MacOS 13/aarch64 This closes the MacOS 12+ SIGSEGV JAWT (CALayer) crash fix, see commits: - 4009198e34b50bba9582be24f33eaf83b94a2cb8 - 3c4cf1f37dc27d8d527804d195361a2287575147 - d969f473fdc72c6ca95f1796ff5af3f0c8bd51b6 - 81f395975c06a66183ad36cc43e8dc9bc7f4545b - b8977465b2fb8452c2560a5d2561b2561472edf0 - 470a0ff3a2efbe43404d5f80a403efb38005598a - 9829550f5bcb586f94f98f6d3c39f4d78fd78f3b
Diffstat (limited to 'src/nativewindow/classes')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index aeb623669..e754bb262 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -95,9 +95,8 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
offscreenSurfaceDrawable=0;
offscreenSurfaceDrawableSet=false;
if( isOffscreenLayerSurfaceEnabled() ) {
- if(0 != windowHandle) {
- OSXUtil.DestroyNSWindow(windowHandle);
- }
+ final long _windowHandle = windowHandle;
+ windowHandle = 0;
final long _rootSurfaceLayer = rootSurfaceLayer;
rootSurfaceLayer = 0;
final long _jawtSurfaceLayersHandle = jawtSurfaceLayersHandle;
@@ -105,6 +104,9 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
OSXUtil.RunOnMainThread(false /* wait */, true /* kickNSApp */, new Runnable() {
@Override
public void run() {
+ if(0 != _windowHandle) {
+ OSXUtil.DestroyNSWindow(_windowHandle);
+ }
if( 0 != _rootSurfaceLayer && 0 != _offscreenSurfaceLayer ) { // Bug 1389
// throws if null == _rootSurfaceLayer
OSXUtil.RemoveCASublayer(_rootSurfaceLayer, _offscreenSurfaceLayer, true);
@@ -372,8 +374,13 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
}
if(null != errMsg) {
if(0 != windowHandle) {
- OSXUtil.DestroyNSWindow(windowHandle);
- windowHandle = 0;
+ final long _windowHandle = windowHandle;
+ windowHandle = 0;
+ OSXUtil.RunOnMainThread(false /* wait */, false, new Runnable() {
+ @Override
+ public void run() {
+ OSXUtil.DestroyNSWindow(_windowHandle);
+ } } );
}
drawable = 0;
unlockSurfaceImpl();