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
This commit is contained in:
joshmoz%gmail.com
2006-12-12 18:55:24 +00:00
parent 17f4a9ade6
commit 7b76adf46a

View File

@@ -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