[Android] Set app & ML instances volatile

Geoffrey Métais git at videolan.org
Tue Jul 18 17:44:09 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jul 18 17:42:57 2017 +0200| [39b3eaa0bd1abda644efb2578df846e329ff9f2c] | committer: Geoffrey Métais

Set app & ML instances volatile

As they are accessed from multiple threads

> https://code.videolan.org/videolan/vlc-android/commit/39b3eaa0bd1abda644efb2578df846e329ff9f2c
---

 vlc-android/src/org/videolan/vlc/VLCApplication.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index 7e81c2308..874427b79 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -55,8 +55,8 @@ public class VLCApplication extends Application {
     public final static String TAG = "VLC/VLCApplication";
 
     public final static String ACTION_MEDIALIBRARY_READY = "VLC/VLCApplication";
-    private static VLCApplication instance;
-    private static Medialibrary sMedialibraryInstance;
+    private static volatile VLCApplication instance;
+    private static volatile Medialibrary sMedialibraryInstance;
 
     public final static String SLEEP_INTENT = Strings.buildPkgString("SleepIntent");
 



More information about the Android mailing list