diff options
-rwxr-xr-x | make/scripts/make.jogl.all.macosx.sh | 4 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java | 9 | ||||
-rw-r--r-- | src/newt/native/MacWindow.m | 11 |
3 files changed, 17 insertions, 7 deletions
diff --git a/make/scripts/make.jogl.all.macosx.sh b/make/scripts/make.jogl.all.macosx.sh index 0eaaa1c71..1c22efe48 100755 --- a/make/scripts/make.jogl.all.macosx.sh +++ b/make/scripts/make.jogl.all.macosx.sh @@ -5,7 +5,9 @@ if [ -e /opt-share/etc/profile.ant ] ; then fi -# -Dc.compiler.debug=true +# -Dc.compiler.debug=true \ +# -Djavacdebug="true" \ +# -Djavacdebuglevel="source,lines,vars" \ ant \ -Drootrel.build=build-macosx \ diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java b/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java index 47c599a25..75a3cf6d5 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java @@ -87,6 +87,9 @@ public class MacWindow extends WindowImpl implements SurfaceChangeable, DriverCl } } finally { setWindowHandle(0); + surfaceHandle = 0; + sscSurfaceHandle = 0; + isOffscreenInstance = false; } } @@ -394,8 +397,8 @@ public class MacWindow extends WindowImpl implements SurfaceChangeable, DriverCl private static final int NSBackingStoreNonretained = 1; private static final int NSBackingStoreBuffered = 2; - private volatile long surfaceHandle; - private long sscSurfaceHandle; - private boolean isOffscreenInstance; + private volatile long surfaceHandle = 0; + private long sscSurfaceHandle = 0; + private boolean isOffscreenInstance = false; } diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m index 5bd0707d4..ddd59f0a1 100644 --- a/src/newt/native/MacWindow.m +++ b/src/newt/native/MacWindow.m @@ -651,8 +651,9 @@ NS_DURING if([mView isInFullScreenMode]) { [mView exitFullScreenModeWithOptions: NULL]; } - [mWin setContentView: nil]; - [mView release]; + // Note: mWin's release will also release it's mView! + // [mWin setContentView: nil]; + // [mView release]; } NS_HANDLER NS_ENDHANDLER @@ -665,7 +666,11 @@ NS_ENDHANDLER DBG_PRINT( "windowClose.1 - %p,%d view %p,%d, parent %p\n", mWin, getRetainCount(mWin), mView, getRetainCount(mView), pWin); - [mWin close]; // performs release! + // '[mWin close]' causes a crash at exit. + // This probably happens b/c it sends events to the main loop + // but our resources are gone ?! + // However, issuing a simple release seems to work quite well. + [mWin release]; DBG_PRINT( "windowClose.X - %p,%d view %p,%d, parent %p\n", mWin, getRetainCount(mWin), mView, getRetainCount(mView), pWin); |