OSDN Git Service

Clear singleton reference during JetPlayer.release()
authorPhil Dubach <phillipd@google.com>
Fri, 31 Jul 2009 00:59:02 +0000 (17:59 -0700)
committerPhil Dubach <phillipd@google.com>
Fri, 31 Jul 2009 00:59:02 +0000 (17:59 -0700)
Only one JetPlayer instance is supported at a time. A singleton reference is
created and returned in JetPlayer.getInstance(). When calling release() on the
instance, the corresponding native player is finalized.  Therefore, release()
must also clear the singleton reference, so that any subsequent call to
getInstance() re-initializes the native player.

media/java/android/media/JetPlayer.java

index 4fb0ead..d75d81d 100644 (file)
@@ -183,6 +183,7 @@ public class JetPlayer
      */
     public void release() {
         native_release();
+        singletonRef = null;
     }