diff options
author | Sven Gothel <[email protected]> | 2012-10-05 03:43:03 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-05 03:43:03 +0200 |
commit | 8f6233f11693f5e079cfeb6706fe2c37b5b9a6c2 (patch) | |
tree | 46db03faad39cb260a83654b87774a0eecabed8f | |
parent | 84632ca22d112da45b807299d2b1f5e4f4107695 (diff) |
Fix regression of commit fbe331f013608eb31ff0d8675f4e4c9881c9c48b: X11 DisplayDriver dispatchMessagesNative() aDevice NPE at finally
The aDevice could be pulled via destroy message, hence add check if null.
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java index a3230fa62..f3a548a08 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java @@ -89,6 +89,7 @@ public class DisplayDriver extends DisplayImpl { } } + @Override protected void closeNativeImpl() { DisplayRelease0(aDevice.getHandle(), javaObjectAtom, windowDeleteAtom); javaObjectAtom = 0; @@ -96,6 +97,7 @@ public class DisplayDriver extends DisplayImpl { aDevice.close(); // closes X11 display } + @Override protected void dispatchMessagesNative() { aDevice.lock(); try { @@ -104,7 +106,9 @@ public class DisplayDriver extends DisplayImpl { DispatchMessages0(handle, javaObjectAtom, windowDeleteAtom); } } finally { - aDevice.unlock(); + if(null != aDevice) { // could be pulled by destroy event + aDevice.unlock(); + } } } |