summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-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];
}