aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes
diff options
context:
space:
mode:
Diffstat (limited to 'src/nativewindow/classes')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index 278ed8a00..aeb623669 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -63,7 +63,6 @@ import jogamp.nativewindow.jawt.JAWTFactory;
import jogamp.nativewindow.jawt.JAWTUtil;
import jogamp.nativewindow.jawt.JAWT_DrawingSurface;
import jogamp.nativewindow.jawt.JAWT_DrawingSurfaceInfo;
-import jogamp.nativewindow.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo;
import jogamp.nativewindow.macosx.OSXUtil;
public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
@@ -99,20 +98,23 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
if(0 != windowHandle) {
OSXUtil.DestroyNSWindow(windowHandle);
}
- OSXUtil.RunOnMainThread(false, true /* kickNSApp */, new Runnable() {
+ final long _rootSurfaceLayer = rootSurfaceLayer;
+ rootSurfaceLayer = 0;
+ final long _jawtSurfaceLayersHandle = jawtSurfaceLayersHandle;
+ jawtSurfaceLayersHandle = 0;
+ OSXUtil.RunOnMainThread(false /* wait */, true /* kickNSApp */, new Runnable() {
@Override
public void run() {
- if( 0 != _offscreenSurfaceLayer ) { // Bug 1389
- OSXUtil.RemoveCASublayer(rootSurfaceLayer, _offscreenSurfaceLayer, true);
+ if( 0 != _rootSurfaceLayer && 0 != _offscreenSurfaceLayer ) { // Bug 1389
+ // throws if null == _rootSurfaceLayer
+ OSXUtil.RemoveCASublayer(_rootSurfaceLayer, _offscreenSurfaceLayer, true);
}
- if( 0 != jawtSurfaceLayersHandle) {
+ if( 0 != _jawtSurfaceLayersHandle) {
// null rootSurfaceLayer OK
- UnsetJAWTRootSurfaceLayer0(jawtSurfaceLayersHandle, rootSurfaceLayer);
+ UnsetJAWTRootSurfaceLayer0(_jawtSurfaceLayersHandle, _rootSurfaceLayer);
}
- jawtSurfaceLayersHandle = 0;
- if( 0 != rootSurfaceLayer ) {
- OSXUtil.DestroyCALayer(rootSurfaceLayer);
- rootSurfaceLayer = 0;
+ if( 0 != _rootSurfaceLayer ) {
+ OSXUtil.DestroyCALayer(_rootSurfaceLayer);
}
}
});