This commit is contained in:
Cameron Kaiser 2017-05-29 17:53:39 -07:00
parent b384d72987
commit 2adbafdb5b

View File

@ -2095,6 +2095,10 @@ nsDocumentViewer::Hide(void)
mPresShell->CaptureHistoryState(getter_AddRefs(layoutState));
}
{
// Do not run ScriptRunners queued by DestroyPresShell() in the intermediate
// state before we're done destroying PresShell, PresContext, ViewManager, etc.
nsAutoScriptBlocker scriptBlocker;
DestroyPresShell();
DestroyPresContext();
@ -2109,6 +2113,7 @@ nsDocumentViewer::Hide(void)
if (base_win && !mAttachedToParent) {
base_win->SetParentWidget(nullptr);
}
}
return NS_OK;
}