From 04d207ce3a47e81fd42c08b98589fe9bbd2d5fc2 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Mon, 3 Nov 2003 19:54:43 +0000 Subject: [PATCH] don't run bookmark menu building code on separate thread as it would case re-entrancy crashes at startup. --- camino/src/application/MainController.mm | 8 +++++--- camino/src/bookmarks/BookmarkManager.mm | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/camino/src/application/MainController.mm b/camino/src/application/MainController.mm index bf147afe90fc..d8ea9b2421bf 100644 --- a/camino/src/application/MainController.mm +++ b/camino/src/application/MainController.mm @@ -312,9 +312,11 @@ const int kReuseWindowOnAE = 2; } // -// this gets called by bookmark load background thread, so it's a possible -// point of contention. but, it's only called once on startup, so probably -// won't be a problem. +// setupBookmarkMenus +// +// Needs to be called at startup after we've initialized the bookmark service. Currently +// it's called on a delayed call after we run through the event loop once, but still +// on the main thread. // - (void)setupBookmarkMenus:(BookmarkManager *)BookmarkManager { diff --git a/camino/src/bookmarks/BookmarkManager.mm b/camino/src/bookmarks/BookmarkManager.mm index 34f2b6798ac6..e524caba2244 100644 --- a/camino/src/bookmarks/BookmarkManager.mm +++ b/camino/src/bookmarks/BookmarkManager.mm @@ -89,7 +89,6 @@ static unsigned gFirstUserCollection = 0; startupLock = nil; [avoidRaceLock unlock]; [avoidRaceLock release]; - [[NSApp delegate] setupBookmarkMenus:gBookmarksManager]; [mainThreadRunLoopMessenger target:gBookmarksManager performSelector:@selector(delayedStartupItems)]; } [pool release]; @@ -180,6 +179,8 @@ static unsigned gFirstUserCollection = 0; - (void)delayedStartupItems { + [[NSApp delegate] setupBookmarkMenus:gBookmarksManager]; + // check update status of 1 bookmark every 2 minutes. mUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:kTimeToCheckAnotherBookmark target:self selector:@selector(checkForUpdates:) userInfo:nil repeats:YES]; [mSmartFolderManager postStartupInitialization:self];