From fc99eaaf4e028bf7ff27b4d3ee340e7f2a6fe6d4 Mon Sep 17 00:00:00 2001 From: "timeless@mozdev.org" Date: Sun, 25 Dec 2005 04:04:36 +0000 Subject: [PATCH] Bug 320488 crash [@ nsSHistory::EvictWindowContentViewer] patch by marria@gmail.com r=biesi sr=darin --- docshell/base/nsDocShell.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 17933d7118da..5da2470ab14f 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -1740,7 +1740,13 @@ nsDocShell::GetLoadedTransIndex(PRInt32 *aLoadedTransIndex) NS_IMETHODIMP nsDocShell::HistoryPurged(PRInt32 aNumEntries) { + // These indices are used for fastback cache eviction, to determine + // which session history entries are candidates for content viewer + // eviction. We need to adjust by the number of entries that we + // just purged from history, so that we look at the right session history + // entries during eviction. mPreviousTransIndex = PR_MAX(-1, mPreviousTransIndex - aNumEntries); + mLoadedTransIndex = PR_MAX(0, mLoadedTransIndex - aNumEntries); PRInt32 count = mChildList.Count(); for (PRInt32 i = 0; i < count; ++i) {