OSDN Git Service

[CMFileManager]Fix CMFileManager sometimes crash.
authorkai.cao <kai.cao@ck-telecom.com>
Wed, 20 May 2015 03:26:05 +0000 (11:26 +0800)
committerGerrit Code Review <gerrit@cyanogenmod.org>
Fri, 22 May 2015 00:07:00 +0000 (00:07 +0000)
sometimes,the CMFileManager crash.

Change-Id: Id82ec92c680248539bb070c30b6bf45c2feab6ab

src/com/cyanogenmod/filemanager/activities/SearchActivity.java

index aa2aba1..b7626e8 100755 (executable)
@@ -450,6 +450,7 @@ public class SearchActivity extends Activity
         } catch (Throwable ex) {
             /**NON BLOCK**/
         }
+        recycle();
 
         //All destroy. Continue
         super.onDestroy();
@@ -1288,10 +1289,13 @@ public class SearchActivity extends Activity
      * Method invoked when the activity needs to exit
      */
     private void exit() {
+        finish();
+    }
+
+    private void recycle() {
         if (this.mSearchListView.getAdapter() != null) {
             ((SearchResultAdapter)this.mSearchListView.getAdapter()).dispose();
         }
-        finish();
     }
 
     /**