Fix crash when going back on pages with (I)FRAMEs. b=304639 r+sr=bryner

This commit is contained in:
mats.palmgren@bredband.net
2005-08-21 12:43:42 +00:00
parent 620c2a30a0
commit 8c4061188e

View File

@@ -7727,7 +7727,9 @@ nsDocShell::SetHistoryEntry(nsCOMPtr<nsISHEntry> *aPtr, nsISHEntry *aEntry)
// newRootEntry is now the new root entry.
// Find the old root entry as well.
nsISHEntry *oldRootEntry = GetRootSHEntry(*aPtr);
// Need a strong ref. on |oldRootEntry| so it isn't destroyed when
// SetChildHistoryEntry() does SwapHistoryEntries() (bug 304639).
nsCOMPtr<nsISHEntry> oldRootEntry = GetRootSHEntry(*aPtr);
if (oldRootEntry) {
nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
GetSameTypeParent(getter_AddRefs(parentAsItem));