Bug 781883 - Ensure the GeckoApp unregisters itself as a tab listener on teardown, or it ends up getting registered multiple times. r=sriram
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 27 Aug 2012 16:44:27 -0400
changeset 105655 3f301dd62fb244821a2a04fe9f9280d675ad5cd6
parent 105654 8264b7d01a5abec721e01bdc8b85c52458e0a3b8
child 105656 12504471edefed3247487d780860893ae84224db
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewerssriram
bugs781883
milestone18.0a1
Bug 781883 - Ensure the GeckoApp unregisters itself as a tab listener on teardown, or it ends up getting registered multiple times. r=sriram
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -2162,16 +2162,18 @@ abstract public class GeckoApp
                 SmsManager.getInstance().shutdown();
         }
 
         super.onDestroy();
 
         if (mBatteryReceiver != null)
             mBatteryReceiver.unregisterFor(mAppContext);
 
+        Tabs.unregisterOnTabsChangedListener(this);
+
         ((GeckoApplication) getApplication()).removeApplicationLifecycleCallbacks(this);
     }
 
     protected void registerEventListener(String event) {
         GeckoAppShell.getEventDispatcher().registerEventListener(event, this);
     }
 
     protected void unregisterEventListener(String event) {