From b2afe804df233eb37f009f35e8f22e5e3bc1bcae Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Wed, 11 Jan 2006 19:45:45 +0000 Subject: [PATCH] Update the loaded index if entries are removed from history, so we don't crash with an invalid entry index. Bug 320488, patch by marria@gmail.com, r=biesi sr=darin a=dveditz git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@187345 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 0dbdf2c964c..5f0d27d1950 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -1727,7 +1727,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) {