[libbluray-devel] Renamed BDJActionQueue.finalize() to shutdown()

hpi1 git at videolan.org
Sun Mar 23 12:16:02 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Mar 23 13:07:23 2014 +0200| [72ada65ddb869eba46e0d00def2e8eeb7b85d045] | committer: hpi1

Renamed BDJActionQueue.finalize() to shutdown()

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

 src/libbluray/bdj/java/org/videolan/BDJActionManager.java |    2 +-
 src/libbluray/bdj/java/org/videolan/BDJActionQueue.java   |    9 ++++++---
 src/libbluray/bdj/java/org/videolan/BDJLoader.java        |    2 +-
 src/libbluray/bdj/java/org/videolan/BDJXletContext.java   |    5 +----
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJActionManager.java b/src/libbluray/bdj/java/org/videolan/BDJActionManager.java
index 9fc3b55..b42d363 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJActionManager.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJActionManager.java
@@ -32,7 +32,7 @@ public class BDJActionManager {
     }
 
     protected void finalize() throws Throwable {
-        commandQueue.finalize();
+        commandQueue.shutdown();
         synchronized (BDJActionManager.class) {
             instance = null;
         }
diff --git a/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java b/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java
index 07c314f..7e56e07 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java
@@ -32,14 +32,17 @@ class BDJActionQueue implements Runnable {
         thread.start();
     }
 
-    protected void finalize() throws Throwable {
+    protected void shutdown() {
         synchronized (actions) {
             terminated = true;
             actions.addLast(null);
             actions.notifyAll();
         }
-        thread.join();
-        super.finalize();
+        try {
+            thread.join();
+        } catch (Throwable t) {
+            Logger.getLogger(BDJActionQueue.class.getName()).error("Error joining thread: " + t);
+        }
     }
 
     public void run() {
diff --git a/src/libbluray/bdj/java/org/videolan/BDJLoader.java b/src/libbluray/bdj/java/org/videolan/BDJLoader.java
index c2cdaf6..13aafaf 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJLoader.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJLoader.java
@@ -93,7 +93,7 @@ public class BDJLoader {
     public static void shutdown() {
         unload();
         try {
-            queue.finalize();
+            queue.shutdown();
         } catch (Throwable e) {
             logger.error("shutdown() failed: " + e);
             e.printStackTrace();
diff --git a/src/libbluray/bdj/java/org/videolan/BDJXletContext.java b/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
index d4559ba..f49378d 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
@@ -296,10 +296,7 @@ public class BDJXletContext implements javax.tv.xlet.XletContext, javax.microedi
             sceneFactory = null;
         }
 
-        try {
-            callbackQueue.finalize();
-        } catch (Throwable t) {
-        }
+        callbackQueue.shutdown();
 
         EventQueue eq = eventQueue;
         eventQueue = null;



More information about the libbluray-devel mailing list