From d365ed6952fea7bbf23ff8005170efd8844c11ff Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 12 Feb 2016 09:44:03 -0800 Subject: [PATCH] Removign optimations in onDestroy > Workspace is still being held at Launcher > DragLayer > DragController > DragListeners > The activity is not GCed immediately whith/without this optimization > No momory/GPU change with/without this optimization Change-Id: I9466ed47adbac717954d1998951937b04bc4cfd5 --- src/com/android/launcher3/Launcher.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 414ebb4b18..ce56740237 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1987,13 +1987,11 @@ public class Launcher extends Activity mWorkspace.removeCallbacks(mBuildLayersRunnable); // Stop callbacks from LauncherModel - LauncherAppState app = (LauncherAppState.getInstance()); - // It's possible to receive onDestroy after a new Launcher activity has // been created. In this case, don't interfere with the new Launcher. if (mModel.isCurrentCallbacks(this)) { mModel.stopLoader(); - app.setLauncher(null); + LauncherAppState.getInstance().setLauncher(null); } try { @@ -2009,12 +2007,6 @@ public class Launcher extends Activity unregisterReceiver(mCloseSystemDialogsReceiver); - mDragLayer.clearAllResizeFrames(); - ((ViewGroup) mWorkspace.getParent()).removeAllViews(); - mWorkspace.removeAllWorkspaceScreens(); - mWorkspace = null; - mDragController = null; - LauncherAnimUtils.onDestroyActivity(); if (mLauncherCallbacks != null) {