From d10c7916a2444b6cb1cf45be3ccb3d6e91a2f1b4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 29 Jun 2012 04:09:48 +0200 Subject: NativeSurface.unlockSurface(): Change fail-fast policy to fail safe tolerant - This policy allows more simple destruction handling w/o validating on the top level. - Hence 'unlockSurface()' shall not throw any exception. - 'lockSurface()' keeps unchanges, clarified w/ explicit 'throws' declaration, ie will fail-fast. --- src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java') diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java b/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java index b45c60e69..942994c13 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/MacWindow.java @@ -104,7 +104,10 @@ public class MacWindow extends WindowImpl implements SurfaceChangeable, DriverCl @Override protected void unlockSurfaceImpl() { if(!isOffscreenInstance) { - unlockSurface0(getWindowHandle()); + final long h = getWindowHandle(); + if(0 != h) { + unlockSurface0(h); + } } } -- cgit v1.2.3