destroy logic cleaned up
authorFilippo Carone <littlejohn@videolan.org>
Wed, 16 May 2007 19:31:35 +0000 (19:31 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Wed, 16 May 2007 19:31:35 +0000 (19:31 +0000)
org/videolan/jvlc/JVLC.java

index 91a8224..4d98133 100644 (file)
@@ -90,8 +90,11 @@ public class JVLC implements Runnable {
      * This is unreversible.
      */
     public void destroy() {
-       beingDestroyed = true;
-       _destroy();
+       if (!beingDestroyed)
+       {
+               beingDestroyed = true;
+               _destroy();
+       }
     }
  
 
@@ -162,10 +165,7 @@ public class JVLC implements Runnable {
         * @see java.lang.Object#finalize()
         */
        protected void finalize() throws Throwable {
-               if (!beingDestroyed)
-               {
-                       destroy();
-               }
+               destroy();
                super.finalize();
        }