[Android] MainActivity: don't crash during onDestroy

Ludovic Fauvet git at videolan.org
Wed Oct 3 16:02:08 CEST 2012


vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Oct  3 15:33:59 2012 +0200| [54278b77eb3f595edc4e8b2c7acd1ab4ac0ceff5] | committer: Ludovic Fauvet

MainActivity: don't crash during onDestroy

If for any reason we don't reach the end of the onCreate() the
thumbnailer may not be instantiated.

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index f2b9f4a..60a9c74 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -342,8 +342,8 @@ public class MainActivity extends SherlockFragmentActivity {
         try {
             unregisterReceiver(messageReceiver);
         } catch (IllegalArgumentException e) {}
-        mThumbnailerManager.clearJobs();
-        super.onDestroy();
+        if (mThumbnailerManager != null)
+            mThumbnailerManager.clearJobs();
     }
 
     @Override



More information about the Android mailing list