Bug 331040 - Crash when removing parent iframe in onbeforunload handler. Patch by Feng Qian, r=bryner, sr=bzbarsky
git-svn-id: svn://10.0.0.236/trunk@193646 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1150,15 +1150,15 @@ DocumentViewerImpl::PermitUnload(PRBool *aPermitUnload)
|
||||
event.target = mDocument;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// In evil cases we might be destroyed while handling the
|
||||
// onbeforeunload event, don't let that happen. (see also bug#331040)
|
||||
nsRefPtr<DocumentViewerImpl> kungFuDeathGrip(this);
|
||||
|
||||
{
|
||||
// Never permit popups from the beforeunload handler, no matter
|
||||
// how we get here.
|
||||
nsAutoPopupStatePusher popupStatePusher(openAbused, PR_TRUE);
|
||||
|
||||
// In evil cases we might be destroyed while handling the
|
||||
// onbeforeunload event, don't let that happen.
|
||||
nsRefPtr<DocumentViewerImpl> kungFuDeathGrip(this);
|
||||
|
||||
mInPermitUnload = PR_TRUE;
|
||||
nsEventDispatcher::Dispatch(window, mPresContext, &event, nsnull, &status);
|
||||
mInPermitUnload = PR_FALSE;
|
||||
|
||||
Reference in New Issue
Block a user