Merge "Fix memory leak in ManageApplication"

This commit is contained in:
Jeff Sharkey
2014-02-06 22:25:30 +00:00
committed by Gerrit Code Review

View File

@@ -321,6 +321,12 @@ public class ManageApplications extends Fragment implements
} }
} }
public void release() {
if (mApplications != null) {
mApplications.release();
}
}
void updateStorageUsage() { void updateStorageUsage() {
// Make sure a callback didn't come at an inopportune time. // Make sure a callback didn't come at an inopportune time.
if (mOwner.getActivity() == null) return; if (mOwner.getActivity() == null) return;
@@ -593,6 +599,10 @@ public class ManageApplications extends Fragment implements
} }
} }
public void release() {
mSession.release();
}
public void rebuild(int sort) { public void rebuild(int sort) {
if (sort == mLastSortMode) { if (sort == mLastSortMode) {
return; return;
@@ -990,6 +1000,7 @@ public class ManageApplications extends Fragment implements
// are no longer attached to their view hierarchy. // are no longer attached to their view hierarchy.
for (int i=0; i<mTabs.size(); i++) { for (int i=0; i<mTabs.size(); i++) {
mTabs.get(i).detachView(); mTabs.get(i).detachView();
mTabs.get(i).release();
} }
} }