Commits

Anonymous committed f3a9578

Fix memory leak in ManageApplication

ApplicationsAdapter new a Session member and make it has a reference to
it self. If we don't release it explicitly, the cross reference will
cause memory leak.

Change-Id: Iecce35ae1d56d98cee6347e84d3a3ff57f3b15a5

Comments (0)

Files changed (1)

src/com/android/settings/applications/ManageApplications.java

             }
         }
 
+        public void release() {
+            if (mApplications != null) {
+                mApplications.release();
+            }
+        }
+
         void updateStorageUsage() {
             // Make sure a callback didn't come at an inopportune time.
             if (mOwner.getActivity() == null) return;
             }
         }
 
+        public void release() {
+            mSession.release();
+        }
+
         public void rebuild(int sort) {
             if (sort == mLastSortMode) {
                 return;
         // are no longer attached to their view hierarchy.
         for (int i=0; i<mTabs.size(); i++) {
             mTabs.get(i).detachView();
+            mTabs.get(i).release();
         }
     }