Bug 1096958 - Part 2: Null mGrid's OnItemClickListener when destroying the view. r=liuche, a=sylvestre
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 02 Feb 2015 11:35:35 -0800
changeset 249557 70a37bdb8ec56f877f3378d385f83c71e735541c
parent 249556 b5e80541fef4b57e95e56d4fed0f0929a12453f3
child 249558 1d9e4d1fe90e164a2a41f627cb8a21cf46fb191c
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, sylvestre
bugs1096958, 930160
milestone37.0a2
Bug 1096958 - Part 2: Null mGrid's OnItemClickListener when destroying the view. r=liuche, a=sylvestre This prevents the listener from being called after some necessary resources are destroyed. There is probably a better solution such as removing the listeners after a successful run, but I'm unsure of the side effects. We know this solution works because of precedent (bug 930160) so let's go with the quick & easy for now.
mobile/android/base/home/TopSitesPanel.java
--- a/mobile/android/base/home/TopSitesPanel.java
+++ b/mobile/android/base/home/TopSitesPanel.java
@@ -299,21 +299,22 @@ public class TopSitesPanel extends HomeF
         }
         return snapshot;
     }
 
     @Override
     public void onDestroyView() {
         super.onDestroyView();
 
-        // Discard any additional item clicks on the list
-        // as the panel is getting destroyed (see bug 930160).
+        // Discard any additional item clicks on the list as the
+        // panel is getting destroyed (see bugs 930160 & 1096958).
         mList.setOnItemClickListener(null);
+        mGrid.setOnItemClickListener(null);
+
         mList = null;
-
         mGrid = null;
         mListAdapter = null;
         mGridAdapter = null;
     }
 
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);