[Android] MediaLibrary: fix unsynchronized lazy initialization

Edward Wang git at videolan.org
Wed Jul 16 18:49:37 CEST 2014


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Wed Jul 16 12:45:13 2014 -0400| [cf55343b6796e16704bf40027fda7e52feb708d1] | committer: Edward Wang

MediaLibrary: fix unsynchronized lazy initialization

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=cf55343b6796e16704bf40027fda7e52feb708d1
---

 vlc-android/src/org/videolan/vlc/MediaLibrary.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaLibrary.java b/vlc-android/src/org/videolan/vlc/MediaLibrary.java
index 290f568..797ba42 100644
--- a/vlc-android/src/org/videolan/vlc/MediaLibrary.java
+++ b/vlc-android/src/org/videolan/vlc/MediaLibrary.java
@@ -101,7 +101,7 @@ public class MediaLibrary {
         return false;
     }
 
-    public static MediaLibrary getInstance() {
+    public synchronized static MediaLibrary getInstance() {
         if (mInstance == null)
             mInstance = new MediaLibrary();
         return mInstance;



More information about the Android mailing list