Bug 753665 - Ensure the mParent reference is nulled out when destroying a child window. r=blassey a=johnath
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 18 Jun 2012 22:29:52 -0400
changeset 96147 766e5964701c7d5430ca111a68ec725591a9f7ac
parent 96145 567afb84828970a875416d4c900923021d5f1dc3
child 96148 0a5054b472f360b46e6e4c604a68051ef5557fca
push id1026
push userkgupta@mozilla.com
push dateFri, 22 Jun 2012 19:27:46 +0000
treeherdermozilla-beta@766e5964701c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey, johnath
bugs753665
milestone14.0
Bug 753665 - Ensure the mParent reference is nulled out when destroying a child window. r=blassey a=johnath
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -279,18 +279,17 @@ nsWindow::Destroy(void)
         // why do we still have children?
         ALOG("### Warning: Destroying window %p and reparenting child %p to null!", (void*)this, (void*)mChildren[i]);
         mChildren[i]->SetParent(nsnull);
     }
 
     if (IsTopLevel())
         gTopLevelWindows.RemoveElement(this);
 
-    if (mParent)
-        mParent->mChildren.RemoveElement(this);
+    SetParent(nsnull);
 
     nsBaseWidget::OnDestroy();
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::ConfigureChildren(const nsTArray<nsIWidget::Configuration>& config)