From 2396a40c90a9f28ee4c63fd7199c38682eaeff70 Mon Sep 17 00:00:00 2001 From: daqiangx Date: Mon, 21 Dec 2015 16:02:25 +0800 Subject: [PATCH] fix out of memory with continuous entry and exit InstalledAppDetail. A session keeps in ApplicationsState list. The fragment don't release the session when it is destroyed. The cause of out of memory is that the session list is increased, but it can't be released. Change-Id: I23635610c9fdfb8a3423299a91cf9b11cb5cdb65 Signed-off-by: daqiangx --- src/com/android/settings/applications/AppInfoBase.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/settings/applications/AppInfoBase.java b/src/com/android/settings/applications/AppInfoBase.java index ff618c2a200..9ef1fed3f91 100644 --- a/src/com/android/settings/applications/AppInfoBase.java +++ b/src/com/android/settings/applications/AppInfoBase.java @@ -105,6 +105,12 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment super.onPause(); } + @Override + public void onDestroy() { + mSession.release(); + super.onDestroy(); + } + protected String retrieveAppEntry() { final Bundle args = getArguments(); mPackageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null;