Bug 624758, [@nsSHistory::EvictContentViewersInRange] and [@nsSHistory::EvictGlobalContentViewer], r=bz

This commit is contained in:
Olli Pettay 2011-03-24 14:22:23 +02:00
parent 5590c58b15
commit 08504d7888

View File

@ -903,10 +903,8 @@ nsSHistory::EvictContentViewersInRange(PRInt32 aStart, PRInt32 aEnd)
{
nsCOMPtr<nsISHTransaction> trans;
GetTransactionAtIndex(aStart, getter_AddRefs(trans));
if (!trans)
return;
for (PRInt32 i = aStart; i < aEnd; ++i) {
for (PRInt32 i = aStart; trans && i < aEnd; ++i) {
nsCOMPtr<nsISHEntry> entry;
trans->GetSHEntry(getter_AddRefs(entry));
nsCOMPtr<nsIContentViewer> viewer;
@ -970,13 +968,8 @@ nsSHistory::EvictGlobalContentViewer()
shist->mIndex + gHistoryMaxViewers);
nsCOMPtr<nsISHTransaction> trans;
shist->GetTransactionAtIndex(startIndex, getter_AddRefs(trans));
if (!trans) {
shist = static_cast<nsSHistory*>(PR_NEXT_LINK(shist));
continue;
}
for (PRInt32 i = startIndex; i <= endIndex; ++i) {
for (PRInt32 i = startIndex; trans && i <= endIndex; ++i) {
nsCOMPtr<nsISHEntry> entry;
trans->GetSHEntry(getter_AddRefs(entry));
nsCOMPtr<nsIContentViewer> viewer;