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

git-svn-id: svn://10.0.0.236/trunk@178538 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mats.palmgren%bredband.net
2005-08-21 12:43:42 +00:00
parent a3d083f268
commit 44a5cb278e

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));