Fix for bug 412774 (Firefox leaks 10 nsGlobalWindows with Page Load Error Page). r=zeniko.

This commit is contained in:
peterv@propagandism.org 2008-02-25 03:27:28 -08:00
Родитель d07aa6a246
Коммит 1bdc36037a
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -506,6 +506,13 @@ SessionStoreService.prototype = {
// cache the window state until the window is completely gone
aWindow.__SS_dyingCache = this._windows[aWindow.__SSi] || this._lastWindowClosed;
// reset the _tab property to avoid keeping the tab's XUL element alive
// longer than we need it
var tabCount = aWindow.__SS_dyingCache.tabs.length;
for (var t = 0; t < tabCount; t++) {
delete aWindow.__SS_dyingCache.tabs[t]._tab;
}
delete aWindow.__SSi;
},
@ -575,6 +582,10 @@ SessionStoreService.prototype = {
// make sure that the tab related data is up-to-date
var tabState = this._collectTabData(aTab);
this._updateTextAndScrollDataForTab(aWindow, aTab.linkedBrowser, tabState);
// reset the _tab property to avoid keeping the tab's XUL element alive
// longer than we need it
delete tabState._tab;
// store closed-tab data for undo
if (tabState.entries.length > 1 || tabState.entries[0].url != "about:blank") {