[libbluray-devel] Fixed root window shutdown sequence. MAke sure overlay is always closed. Do not allow overlay updates after window has been disposed.

hpi1 git at videolan.org
Tue Jun 11 15:15:56 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Jun 11 11:33:36 2013 +0300| [0dac49fdbd11b169c5453a9767827bfb70a624cf] | committer: hpi1

Fixed root window shutdown sequence. MAke sure overlay is always closed. Do not allow overlay updates after window has been disposed.

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

 src/libbluray/bdj/java/java/awt/BDRootWindow.java |   23 ++++++++++++++-------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/libbluray/bdj/java/java/awt/BDRootWindow.java b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
index b49de44..112b087 100644
--- a/src/libbluray/bdj/java/java/awt/BDRootWindow.java
+++ b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
@@ -66,6 +66,10 @@ public class BDRootWindow extends Frame {
             return;
         }
         synchronized (this) {
+            if (timer == null) {
+                org.videolan.Logger.getLogger("BDRootWindow").error("notifyChanged(): window already disposed");
+                return;
+            }
             changeCount++;
             if (timerTask == null) {
                 timerTask = new RefreshTimerTask(this);
@@ -145,17 +149,20 @@ public class BDRootWindow extends Frame {
 
     public void dispose()
     {
+        synchronized (this) {
+            if (timerTask != null) {
+                timerTask.cancel();
+                timerTask = null;
+            }
+            if (timer != null) {
+                timer.cancel();
+                timer = null;
+            }
+        }
+
         if (isVisible()) {
             hide();
         }
-        if (timerTask != null) {
-            timerTask.cancel();
-            timerTask = null;
-        }
-        if (timer != null) {
-            timer.cancel();
-            timer = null;
-        }
 
         BDToolkit.setFocusedWindow(null);
 



More information about the libbluray-devel mailing list