Bug 753665 - Ensure the mParent reference is nulled out when destroying a child window. r=blassey
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 18 Jun 2012 22:29:52 -0400
changeset 101789 4180a4a2ebf2da0195b8899170e164b7d2d82112
parent 101788 421ed10b0e817c04dd6aef4611fc4027b15b5aa0
child 101790 e22422f1cc59a820814718af8b8e4b57276c9458
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs753665
milestone16.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 753665 - Ensure the mParent reference is nulled out when destroying a child window. r=blassey
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -245,18 +245,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[0]);
         mChildren[0]->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)