mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
2239 Crash when leaving test9
This commit is contained in:
parent
a2439bb775
commit
559c7cca3c
widget/src/mac
@ -74,6 +74,7 @@ void nsToolkit::SetFocus(nsWindow *aFocusWidget)
|
||||
guiEvent.message = NS_LOSTFOCUS;
|
||||
guiEvent.widget = mFocusedWidget;
|
||||
mFocusedWidget->DispatchWindowEvent(guiEvent);
|
||||
mFocusedWidget = nil;
|
||||
}
|
||||
|
||||
// let the new one know
|
||||
|
@ -75,7 +75,7 @@ nsWindow::~nsWindow()
|
||||
::DisposeRgn(mWindowRegion);
|
||||
mWindowRegion = nsnull;
|
||||
}
|
||||
|
||||
|
||||
NS_IF_RELEASE(mTempRenderingContext);
|
||||
}
|
||||
|
||||
@ -170,7 +170,13 @@ NS_IMETHODIMP nsWindow::Destroy()
|
||||
if (mDestroyCalled)
|
||||
return NS_OK;
|
||||
mDestroyCalled = PR_TRUE;
|
||||
|
||||
|
||||
// if the window being destroyed has the focus, lose it so that there isn't a dangling reference
|
||||
if (mToolkit && ((nsToolkit*)mToolkit)->GetFocus() == this )
|
||||
{
|
||||
((nsToolkit*)mToolkit)->SetFocus( nil );
|
||||
}
|
||||
|
||||
nsBaseWidget::OnDestroy();
|
||||
nsBaseWidget::Destroy();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user