summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-31 21:14:41 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-31 21:14:41 +0000
commit2b0a53c333584133e5fb67996fcc70c0c9041a5f (patch)
tree06990b7a429f01ca77bb776e397760fe3dcfa9f6 /chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
parentab0c9af516dc7c07155d159c6de105767a293ce8 (diff)
downloadchromium_src-2b0a53c333584133e5fb67996fcc70c0c9041a5f.zip
chromium_src-2b0a53c333584133e5fb67996fcc70c0c9041a5f.tar.gz
chromium_src-2b0a53c333584133e5fb67996fcc70c0c9041a5f.tar.bz2
OSX: Remove some nsnotificationcenter observers more reliably.
There are some crashers which show up as an objc_msgSend when posting a notification. So I went around reviewing our observers looking for places where it's possible that we weren't unregistering correctly. These may have already been correct, but this change would seem to make unregistration more reliable. Review URL: http://codereview.chromium.org/174480 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24938 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_edit_view_mac.mm')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.mm8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index 4ca90df..d632046 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
@@ -184,9 +184,6 @@ AutocompleteEditViewMac::~AutocompleteEditViewMac() {
// Disconnect field_ from edit_helper_ so that we don't get calls
// after destruction.
[field_ setDelegate:nil];
-
- // Disconnect notifications so they don't signal a dead object.
- [[NSNotificationCenter defaultCenter] removeObserver:edit_helper_];
}
void AutocompleteEditViewMac::SaveStateToTab(TabContents* tab) {
@@ -721,6 +718,11 @@ std::wstring AutocompleteEditViewMac::GetClipboardText(Clipboard* clipboard) {
return self;
}
+- (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [super dealloc];
+}
+
- (BOOL)control:(NSControl*)control
textView:(NSTextView*)textView doCommandBySelector:(SEL)cmd {
// Don't intercept up/down-arrow if the popup isn't open.