Bug 585813 - Script timeout at tabbrowser.xml:1457 when closing tabs; r=dao

This commit is contained in:
Tim Taubert 2012-02-17 13:29:25 +01:00
parent 162742acd3
commit 5c9c25807a

View File

@ -1557,15 +1557,26 @@
<parameter name="aCloseWindowFastpath"/>
<body>
<![CDATA[
if (aTab.closing || this._windowIsClosing)
if (aTab.closing ||
aTab._pendingPermitUnload ||
this._windowIsClosing)
return false;
var browser = this.getBrowserForTab(aTab);
if (!aTabWillBeMoved) {
let ds = browser.docShell;
if (ds && ds.contentViewer && !ds.contentViewer.permitUnload())
return false;
if (ds && ds.contentViewer) {
// We need to block while calling permitUnload() because it
// processes the event queue and may lead to another removeTab()
// call before permitUnload() even returned.
aTab._pendingPermitUnload = true;
let permitUnload = ds.contentViewer.permitUnload();
delete aTab._pendingPermitUnload;
if (!permitUnload)
return false;
}
}
var closeWindow = false;