From 85d4923c52f8d91de37e24f67c1ce152af30eb2e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 23 Apr 2010 00:48:42 +0200 Subject: Add missing finally unlock, if 2nd lock fails --- src/newt/classes/com/jogamp/newt/macosx/MacWindow.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/newt/classes/com/jogamp/newt/macosx/MacWindow.java b/src/newt/classes/com/jogamp/newt/macosx/MacWindow.java index 276843709..52d6fb0c7 100755 --- a/src/newt/classes/com/jogamp/newt/macosx/MacWindow.java +++ b/src/newt/classes/com/jogamp/newt/macosx/MacWindow.java @@ -216,7 +216,12 @@ public class MacWindow extends Window { public synchronized int lockSurface() throws NativeWindowException { nsViewLock.lock(); - return super.lockSurface(); + try { + return super.lockSurface(); + } catch (RuntimeException re) { + nsViewLock.unlock(); + throw re; + } } public void unlockSurface() { -- cgit v1.2.3