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 243654 c860bf9bc4a8
parent 243653 47e26f891d66
child 243655 41fac15f269a
child 243657 9198cf7b5f32
push id4423
push userrnewman@mozilla.com
push date2015-02-02 21:41 +0000
treeherdermozilla-beta@c860bf9bc4a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, sylvestre
bugs1096958, 930160
milestone36.0
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);