From 7b76adf46a7c953e09e7343ffb4e1416680e8be9 Mon Sep 17 00:00:00 2001 From: "joshmoz%gmail.com" Date: Tue, 12 Dec 2006 18:55:24 +0000 Subject: [PATCH] When a top-level window's parent is destroyed, the parent should set the parent pointer on its children to null. We do this in the other Mac nsIWidget impls, someone just forgot to do it in cocoa top-level windows. b=362952 r=mano r=smorgan git-svn-id: svn://10.0.0.236/trunk@216892 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/cocoa/nsCocoaWindow.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/widget/src/cocoa/nsCocoaWindow.mm b/mozilla/widget/src/cocoa/nsCocoaWindow.mm index 795b2251d60..a4bf0a6403a 100644 --- a/mozilla/widget/src/cocoa/nsCocoaWindow.mm +++ b/mozilla/widget/src/cocoa/nsCocoaWindow.mm @@ -131,6 +131,12 @@ nsCocoaWindow::nsCocoaWindow() // nsCocoaWindow::~nsCocoaWindow() { + // notify the children that we're gone + for (nsIWidget* kid = mFirstChild; kid; kid = kid->GetNextSibling()) { + nsCocoaWindow* childWindow = NS_STATIC_CAST(nsCocoaWindow*, kid); + childWindow->mParent = nsnull; + } + if (mWindow && mWindowMadeHere) { // we want to unhook the delegate here because we don't want events // sent to it after this object has been destroyed