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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user