From 2d43096d03fde4cd3f609bcd6d64b402c2559df6 Mon Sep 17 00:00:00 2001 From: "alqahira%ardisson.org" Date: Mon, 6 Oct 2008 17:18:49 +0000 Subject: [PATCH] Bug 458527 - Recently closed pages not tracked until History menu is accessed. Patch by Stuart Morgan , r/sr=pink git-svn-id: svn://10.0.0.236/trunk@254540 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/camino/src/browser/HistoryMenu.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mozilla/camino/src/browser/HistoryMenu.mm b/mozilla/camino/src/browser/HistoryMenu.mm index 8ec3e2b87e7..7a27ebdaa83 100644 --- a/mozilla/camino/src/browser/HistoryMenu.mm +++ b/mozilla/camino/src/browser/HistoryMenu.mm @@ -578,10 +578,17 @@ static const unsigned int kMaxTitleLength = 50; // If rootChangedItem is nil, the whole history tree is being rebuilt. if (!rootChangedItem) { - [mRecentlyClosedMenu release]; - mRecentlyClosedMenu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"RecentlyClosed", nil)]; [mTodayItem release]; mTodayItem = nil; + // We can get here either when the history is being cleared (in which case + // we will already have an mRootItem) or when we are doing the lazy + // construction of the root item as the menu is shown (in which case + // mRootItem is still |nil|). If it's the former, clear the recently closed + // pages as well. + if (mRootItem) { + [mRecentlyClosedMenu release]; + mRecentlyClosedMenu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"RecentlyClosed", nil)]; + } } else if (mTodayItem == rootChangedItem || mTodayItem == [rootChangedItem parentItem])