Bug 897095 - Don't call restoreHistory() for closed windows; r=smacleod

This commit is contained in:
Tim Taubert 2013-09-24 19:59:07 +02:00
parent cc31fa6e4f
commit 76a179666d

View File

@ -2585,7 +2585,6 @@ let SessionStoreInternal = {
restoreHistory:
function ssi_restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap,
aRestoreImmediately) {
var _this = this;
// if the tab got removed before being completely restored, then skip it
while (aTabs.length > 0 && !(this._canRestoreTabHistory(aTabs[0]))) {
aTabs.shift();
@ -2654,9 +2653,11 @@ let SessionStoreInternal = {
tab.dispatchEvent(event);
// Restore the history in the next tab
aWindow.setTimeout(function(){
_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap,
aRestoreImmediately);
aWindow.setTimeout(() => {
if (!aWindow.closed) {
this.restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap,
aRestoreImmediately);
}
}, 0);
// This could cause us to ignore MAX_CONCURRENT_TAB_RESTORES a bit, but