summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Baard <henrik.baard@sonymobile.com>2013-07-23 09:31:57 +0200
committerHenrik Baard <henrik.baard@sonymobile.com>2013-08-07 12:02:30 +0200
commitae15594549427e18825071edc60fc63f144ba585 (patch)
treea47b31672f28aec0cf310553a000b9f174f3b405
parent523db46f6981a40e12007dbbe629bbdc47f861ba (diff)
downloadframeworks_base-ae15594549427e18825071edc60fc63f144ba585.zip
frameworks_base-ae15594549427e18825071edc60fc63f144ba585.tar.gz
frameworks_base-ae15594549427e18825071edc60fc63f144ba585.tar.bz2
GlobalAction dialog ref not set to null
When a GlobalAction dialog is dismissed when screen goes into sleep the reference mDialog is not set to null. Next time the long presses power button and brings up the GlobalAction dialog the old reference still exist and we try to dismiss the dialog again even if it does not exist. The dialog reference in this case holds on to the dialog object using more memory than neccesary, and in rare cases we might get a crash when the dialog object is dissmissed the second time. Change-Id: I44ef1c385d90777e8f6dd9fe111eb3d9b0d3cf3f
-rw-r--r--policy/src/com/android/internal/policy/impl/GlobalActions.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java
index a2ac8fe..b978863 100644
--- a/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -879,6 +879,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
case MESSAGE_DISMISS:
if (mDialog != null) {
mDialog.dismiss();
+ mDialog = null;
}
break;
case MESSAGE_REFRESH: