Bug 824474: Proper cleanup of tabs-tray while hiding. [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Wed, 26 Dec 2012 12:56:34 -0800
changeset 126168 8f5e2129e89db8c8205c6fd037b6bf734907178b
parent 126167 ecf7bc3e34b3d8a3f09f5f9dfeff9694f12c55bc
child 126169 01afbc4615091858166fa72f134fb5fc379b6451
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs824474
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 824474: Proper cleanup of tabs-tray while hiding. [r=mfinkle]
mobile/android/base/TabsPanel.java
mobile/android/base/TabsTray.java
--- a/mobile/android/base/TabsPanel.java
+++ b/mobile/android/base/TabsPanel.java
@@ -405,16 +405,19 @@ public class TabsPanel extends TabHost
         }
     }
 
     public void hide() {
         if (mVisible) {
             mVisible = false;
             mPopupMenu.dismiss();
             dispatchLayoutChange(0, 0);
+
+            mPanel.hide();
+            mPanel = null;
         }
     }
 
     public void refresh() {
         clearAllTabs();
         removeAllViews();
 
         LayoutInflater.from(mContext).inflate(R.layout.tabs_panel, this);
--- a/mobile/android/base/TabsTray.java
+++ b/mobile/android/base/TabsTray.java
@@ -217,17 +217,17 @@ public class TabsTray extends ListView
         private int getPositionForTab(Tab tab) {
             if (mTabs == null || tab == null)
                 return -1;
 
             return mTabs.indexOf(tab);
         }
 
         private void removeTab(Tab tab) {
-            if (tab.isPrivate() == mIsPrivate) {
+            if (tab.isPrivate() == mIsPrivate && mTabs != null) {
                 mTabs.remove(tab);
                 notifyDataSetChanged(); // Be sure to call this whenever mTabs changes.
             }
         }
 
         private void assignValues(TabRow row, Tab tab) {
             if (row == null || tab == null)
                 return;