diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-05 22:55:00 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-05 22:55:00 +0000 |
commit | 383c6112f1cb327bd3b885bd0837d35b83a4db6d (patch) | |
tree | d6d1b255f7730dea3e9370374efc14a47964b12a /chrome/browser/ui/cocoa | |
parent | c2970c83f2582e7eefb9930a2bc2b4ddedcc37f3 (diff) | |
download | chromium_src-383c6112f1cb327bd3b885bd0837d35b83a4db6d.zip chromium_src-383c6112f1cb327bd3b885bd0837d35b83a4db6d.tar.gz chromium_src-383c6112f1cb327bd3b885bd0837d35b83a4db6d.tar.bz2 |
Fix obscure crash when a window was resized between a translate infobar's closure and destruction.
BUG=124694
TEST=none; no crashes like those in the bug
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=135521
Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=135547
Review URL: http://codereview.chromium.org/10375018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa')
-rw-r--r-- | chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm index 00894e2..e13e4da 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm @@ -395,6 +395,9 @@ InfoBar* TranslateInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { [self disablePopUpMenu:[fromLanguagePopUp_ menu]]; [self disablePopUpMenu:[toLanguagePopUp_ menu]]; [self disablePopUpMenu:[optionsPopUp_ menu]]; + // [super infobarWillClose] clears the owner field which is relied on by the + // notification handler, so remove the handler first. + [[NSNotificationCenter defaultCenter] removeObserver:self]; [super infobarWillClose]; } @@ -488,6 +491,8 @@ InfoBar* TranslateInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { } - (void)dealloc { + // Perhaps this was removed as an observer in -infobarWillClose, but there's + // no guarantee that that was the case. [[NSNotificationCenter defaultCenter] removeObserver:self]; [showOriginalButton_ setTarget:nil]; [translateMessageButton_ setTarget:nil]; |