summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 03:37:32 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 03:37:32 +0000
commit73eecfb80293b782efe1ae4397d775b20f4ca56f (patch)
treead8ebd36b99f86b47b00171f537ecf7d0769d37a
parent46ca36338f43a9a1298c188110cd9defacac04cc (diff)
downloadchromium_src-73eecfb80293b782efe1ae4397d775b20f4ca56f.zip
chromium_src-73eecfb80293b782efe1ae4397d775b20f4ca56f.tar.gz
chromium_src-73eecfb80293b782efe1ae4397d775b20f4ca56f.tar.bz2
[Mac] Fix crash for "settings" case of protector bubble.
If the current page was not NTP, the code to go to settings caused a new tab to be brought up, which caused the bubble to be closed (by base bubble controller), and then the second call to -close caused a crash. The duplicate calls to -close should be fine, but the message to a freed |error_| needed to be dropped. BUG=102681 TEST=Arrange to be on a website (like google) at startup. Arrange to get the protector bubble up on startup, and click the settings option. Should go to the settings, and not crash. Review URL: http://codereview.chromium.org/8372088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108420 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/global_error_bubble_controller.h1
-rw-r--r--chrome/browser/ui/cocoa/global_error_bubble_controller.mm4
2 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/ui/cocoa/global_error_bubble_controller.h b/chrome/browser/ui/cocoa/global_error_bubble_controller.h
index 8061104..63e5605 100644
--- a/chrome/browser/ui/cocoa/global_error_bubble_controller.h
+++ b/chrome/browser/ui/cocoa/global_error_bubble_controller.h
@@ -16,6 +16,7 @@ class GlobalError;
// about a global error.
@interface GlobalErrorBubbleController : BaseBubbleController {
@private
+ // |error_| can be NULL after -close is called.
GlobalError* error_;
IBOutlet NSImageView* iconView_;
diff --git a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm
index a1d5f77..1691e7e 100644
--- a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm
@@ -86,7 +86,9 @@ const CGFloat kWrenchBubblePointOffsetY = 6;
}
- (void)close {
- error_->BubbleViewDidClose();
+ if (error_)
+ error_->BubbleViewDidClose();
+ error_ = NULL;
BrowserWindowController* bwc = [BrowserWindowController
browserWindowControllerForWindow:[self parentWindow]];
[bwc releaseBarVisibilityForOwner:self withAnimation:YES delay:NO];