summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-06-29 04:09:48 +0200
committerSven Gothel <[email protected]>2012-06-29 04:09:48 +0200
commitd10c7916a2444b6cb1cf45be3ccb3d6e91a2f1b4 (patch)
tree35565df0357b1c3fd96ecc5ac92c6dbf0ff45993 /src/nativewindow/classes/jogamp
parent89b09958ef1ad9cdc228517d2acaa0dc27aa559f (diff)
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.
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
index 4da48bdae..c24f64b32 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
@@ -74,13 +74,12 @@ public class GDISurface extends ProxySurface {
@Override
final protected void unlockSurfaceImpl() {
- if (0 == surfaceHandle) {
- throw new InternalError("surface not acquired: "+this+", thread: "+Thread.currentThread().getName());
- }
- if(0 == GDI.ReleaseDC(windowHandle, surfaceHandle)) {
- throw new NativeWindowException("DC not released: "+this+", isWindow "+GDI.IsWindow(windowHandle)+", werr "+GDI.GetLastError()+", thread: "+Thread.currentThread().getName());
+ if (0 != surfaceHandle) {
+ if(0 == GDI.ReleaseDC(windowHandle, surfaceHandle)) {
+ throw new NativeWindowException("DC not released: "+this+", isWindow "+GDI.IsWindow(windowHandle)+", werr "+GDI.GetLastError()+", thread: "+Thread.currentThread().getName());
+ }
+ surfaceHandle=0;
}
- surfaceHandle=0;
}
@Override