From 833045b419a501d5d7d0501dc8b2555b86e90474 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 23 Jan 2014 17:31:42 +0100 Subject: NEWT X11 DisplayDriver.dispatchMessagesNative(): Avoid aDevice NPE while being pulled --- src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') 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(); } } -- cgit v1.2.3