зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1669096: Add missing kungFuDeathGrip. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D92490
This commit is contained in:
Родитель
cee53e9c91
Коммит
eeec43da78
|
@ -1201,6 +1201,11 @@ bool nsDocumentViewer::GetIsStopped() { return mStopped; }
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocumentViewer::PermitUnload(PermitUnloadAction aAction,
|
nsDocumentViewer::PermitUnload(PermitUnloadAction aAction,
|
||||||
bool* aPermitUnload) {
|
bool* aPermitUnload) {
|
||||||
|
// We're going to be running JS and nested event loops, which could cause our
|
||||||
|
// DocShell to be destroyed. Make sure we stay alive until the end of the
|
||||||
|
// function.
|
||||||
|
RefPtr<nsDocumentViewer> kungFuDeathGrip(this);
|
||||||
|
|
||||||
if (StaticPrefs::dom_disable_beforeunload()) {
|
if (StaticPrefs::dom_disable_beforeunload()) {
|
||||||
aAction = eDontPromptAndUnload;
|
aAction = eDontPromptAndUnload;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче