From ae15594549427e18825071edc60fc63f144ba585 Mon Sep 17 00:00:00 2001 From: Henrik Baard Date: Tue, 23 Jul 2013 09:31:57 +0200 Subject: [PATCH] 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 --- policy/src/com/android/internal/policy/impl/GlobalActions.java | 1 + 1 file changed, 1 insertion(+) diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java index a2ac8feb5dc2..b978863fb7aa 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: -- 2.11.0