Clear the old child docshells when SetDOMDocument is called, so that they don't get persisted in session history before they're GC'd. Also, update SHEntry to hold strong references to the child docshells. Bug 319551, r=sicking sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@200898 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2006-06-26 18:48:52 +00:00
parent 1923b801b9
commit 22f63d0a84
4 changed files with 17 additions and 8 deletions

View File

@@ -1476,6 +1476,19 @@ DocumentViewerImpl::Destroy()
if (mPrintEngine->CheckBeforeDestroy()) {
return NS_OK;
}
// Clear the list of old child docshells. CChild docshells for the new
// document will be constructed as frames are created.
nsCOMPtr<nsIDocShellTreeNode> node = do_QueryInterface(container);
if (node) {
PRInt32 count;
node->GetChildCount(&count);
for (PRInt32 i = 0; i < count; ++i) {
nsCOMPtr<nsIDocShellTreeItem> child;
node->GetChildAt(0, getter_AddRefs(child));
node->RemoveChild(child);
}
}
}
#endif