diff options
author | Sven Gothel <sgothel@jausoft.com> | 2014-01-23 17:31:42 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2014-01-23 17:31:42 +0100 |
commit | 833045b419a501d5d7d0501dc8b2555b86e90474 (patch) | |
tree | 91bbfd1c12e8fe7504b614a0ffd4cc58ce912235 /src | |
parent | e8958457632d3faaaefda727d9b5c383373dff3b (diff) |
NEWT X11 DisplayDriver.dispatchMessagesNative(): Avoid aDevice NPE while being pulled
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java index 391b8b19d..5c2820dab 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java @@ -105,16 +105,15 @@ public class DisplayDriver extends DisplayImpl { @Override protected void dispatchMessagesNative() { - aDevice.lock(); + final AbstractGraphicsDevice _aDevice = aDevice; // aDevice could be pulled by destroy event + _aDevice.lock(); try { - final long handle = aDevice.getHandle(); + final long handle = _aDevice.getHandle(); if(0 != handle) { DispatchMessages0(handle, javaObjectAtom, windowDeleteAtom /*, kbdHandle */); // XKB disabled for now } } finally { - if(null != aDevice) { // could be pulled by destroy event - aDevice.unlock(); - } + _aDevice.unlock(); } } |