From 534d764474cacf8bc380123cbfd164c7c55f236a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 8 Sep 2019 12:56:57 +0200 Subject: Buig 1389: Fix SIGSEGV on OpenJDK11 on [NSApplicationAWT sendEvent:] Culprit of the crash and the non propagated action on NSApp main-thread was _simply_ our OSXUtil_KickNSApp() 'kick alive' NSApplicationDefined NSEvent sent to the NSApp. Java11's NSApp code overrides sendEvent and handles NSApplicationDefined + subtype=ExecuteBlockEvent using the given data1 as a function pointer. 8-O ExecuteBlockEvent defined as 0, which we have sent. Simply passing subtype=8888 avoids this side-effect. Whether it is still required to KickNSApp() is another question. +++ Further, make code a bit more robuts regarding the offscreenSurfaceLayer at JAWTWindow invalidate. I.e. if still not detached, do the late cleanup there. This just in case the OSX Context callback to disassociate the drawable has been missed. --- src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nativewindow/classes/com') diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java index 71a7602e6..5b8171e96 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java @@ -270,6 +270,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, invalidateNative(); jawt = null; awtConfig = null; + offscreenSurfaceLayer = 0; // Bug 1389 isOffscreenLayerSurface = false; drawable= 0; drawable_old = 0; @@ -534,7 +535,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, throw new NativeWindowException("No offscreen layer attached: "+this); } if(DEBUG) { - System.err.println("JAWTWindow.detachSurfaceHandle(): osh "+toHexString(offscreenSurfaceLayer)); + System.err.println("JAWTWindow.detachSurfaceHandle(): osh "+toHexString(offscreenSurfaceLayer)+" - "+Thread.currentThread().getName()); } detachSurfaceLayerImpl(offscreenSurfaceLayer, detachSurfaceLayerNotify); } -- cgit v1.2.3