[libbluray-devel] Fixed BDRootWindow.stopEventQueue() when event dispatch threads are launched on demand

hpi1 git at videolan.org
Mon Apr 8 11:21:59 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Apr  1 23:27:23 2013 +0300| [9f827e72b56f1c345fb3bf6d6e36c8936a7cdcce] | committer: hpi1

Fixed BDRootWindow.stopEventQueue() when event dispatch threads are launched on demand

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=9f827e72b56f1c345fb3bf6d6e36c8936a7cdcce
---

 src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java |    2 +-
 src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java |    2 +-
 src/libbluray/bdj/java/java/awt/BDRootWindow.java   |    5 ++++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java b/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java
index 7798506..dd98aa0 100644
--- a/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java
+++ b/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java
@@ -59,7 +59,7 @@ public class BDToolkit extends Toolkit {
 
     public void dispose() {
         if (eventQueue != null) {
-            eventQueue.getDispatchThread().stopDispatching();
+            BDRootWindow.stopEventQueue(eventQueue);
             eventQueue = null;
         }
         cachedImages = null;
diff --git a/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java b/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java
index c35b1e1..4aa1935 100644
--- a/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java
+++ b/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java
@@ -61,7 +61,7 @@ public class BDToolkit extends Toolkit implements KeyboardFocusManagerPeerProvid
 
     public void dispose() {
         if (eventQueue != null) {
-            eventQueue.getDispatchThread().stopDispatching();
+            BDRootWindow.stopEventQueue(eventQueue);
             eventQueue = null;
         }
         BDKeyboardFocusManagerPeer.shutdown();
diff --git a/src/libbluray/bdj/java/java/awt/BDRootWindow.java b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
index d0a35d9..58dc5ad 100644
--- a/src/libbluray/bdj/java/java/awt/BDRootWindow.java
+++ b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
@@ -67,7 +67,10 @@ public class BDRootWindow extends Frame {
     }
 
     public static void stopEventQueue(EventQueue eq) {
-        eq.getDispatchThread().stopDispatching();
+        EventDispatchThread t = eq.getDispatchThread();
+        if (t != null) {
+            t.stopDispatching();
+        }
     }
 
     public void postKeyEvent(int id, int modifiers, int keyCode) {



More information about the libbluray-devel mailing list