Destroy content viewers in session history when destroying docshell, just like we destroy the current one. (Bug 488394) r+sr=bzbarsky

This commit is contained in:
L. David Baron 2009-04-16 13:55:13 -07:00
Родитель d718b83774
Коммит 69912fb1ac
1 изменённых файлов: 12 добавлений и 1 удалений

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

@ -3849,7 +3849,18 @@ nsDocShell::Destroy()
mScriptGlobal = nsnull;
}
mSessionHistory = nsnull;
if (mSessionHistory) {
// We want to destroy these content viewers now rather than
// letting their destruction wait for the session history
// entries to get garbage collected. (Bug 488394)
nsCOMPtr<nsISHistoryInternal> shPrivate =
do_QueryInterface(mSessionHistory);
if (shPrivate) {
shPrivate->EvictAllContentViewers();
}
mSessionHistory = nsnull;
}
SetTreeOwner(nsnull);
// required to break ref cycle