summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 23:23:23 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 23:23:23 +0000
commit865f447f8aa94000f9669a0d1e24c27d20b0c79c (patch)
treec999db0ac1696a51c22ffca7c8ed10d51b032930 /chrome
parent015c0e105861f82fbbbbd0fa6380742f66ae6247 (diff)
downloadchromium_src-865f447f8aa94000f9669a0d1e24c27d20b0c79c.zip
chromium_src-865f447f8aa94000f9669a0d1e24c27d20b0c79c.tar.gz
chromium_src-865f447f8aa94000f9669a0d1e24c27d20b0c79c.tar.bz2
Make bubble more tolerant of notification order when quitting.
BUG=http://crbug.com/37807 TEST=\ Run a debug build of Chrome like this: NSZombieEnabled=YES xcodebuild/Debug/Chromium.app/Contents/MacOS/Chromium Open a bubble then Cmd-Q. Make sure you don't see a line like this: 2010-03-10 19:24:20.381 Chromium[73024:903] *** -[ChromeBrowserWindow removeChildWindow:]: message sent to deallocated instance 0x18f8b2a0 Repeat 20 times. Review URL: http://codereview.chromium.org/839003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/bookmark_bubble_controller.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.mm b/chrome/browser/cocoa/bookmark_bubble_controller.mm
index be1fd30..a2e4737 100644
--- a/chrome/browser/cocoa/bookmark_bubble_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bubble_controller.mm
@@ -123,6 +123,15 @@
- (void)close {
[parentWindow_ removeChildWindow:[self window]];
+
+ // If you quit while the bubble is open, sometimes we get a
+ // DidResignKey before we get our parent's WindowWillClose and
+ // sometimes not. We protect against a multiple close (or reference
+ // to parentWindow_ at a bad time) by clearing it out once we're
+ // done, and by removing ourself from future notifications.
+ parentWindow_ = nil;
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
[super close];
}