diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 20:43:19 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 20:43:19 +0000 |
commit | f190829779ea89e1303ebbc18ff56bc2fb8eb862 (patch) | |
tree | 5bd9af2628c66388e6265333b31046144843afa4 /chrome/browser/cocoa/history_menu_bridge.h | |
parent | b32cd51e9f8669dd9ee62a2d36e31b5fda139452 (diff) | |
download | chromium_src-f190829779ea89e1303ebbc18ff56bc2fb8eb862.zip chromium_src-f190829779ea89e1303ebbc18ff56bc2fb8eb862.tar.gz chromium_src-f190829779ea89e1303ebbc18ff56bc2fb8eb862.tar.bz2 |
Make the HistoryMenuBridge::HistoryItem co-own the NSMenuItem. This hopefully fixes a top-crash.
BUG=46289
TEST=Open 3 windows, with 10-12 tabs in each. Cmd+W rapidly. Chrome doesn't crash. See bug for details.
Review URL: http://codereview.chromium.org/2836008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/history_menu_bridge.h')
-rw-r--r-- | chrome/browser/cocoa/history_menu_bridge.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/history_menu_bridge.h b/chrome/browser/cocoa/history_menu_bridge.h index ef84031..92be247 100644 --- a/chrome/browser/cocoa/history_menu_bridge.h +++ b/chrome/browser/cocoa/history_menu_bridge.h @@ -88,8 +88,12 @@ class HistoryMenuBridge : public NotificationObserver, // The Handle given to us by the FaviconService for the icon fetch request. FaviconService::Handle icon_handle; - // The pointer to the item after it has been created. Weak. - NSMenuItem* menu_item; + // The pointer to the item after it has been created. Strong; NSMenu also + // retains this. During a rebuild flood (if the user closes a lot of tabs + // quickly), the NSMenu can release the item before the HistoryItem has + // been fully deleted. If this were a weak pointer, it would result in a + // zombie. + scoped_nsobject<NSMenuItem> menu_item; // This ID is unique for a browser session and can be passed to the // TabRestoreService to re-open the closed window or tab that this |