summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 17:47:45 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 17:47:45 +0000
commit7716bfdc8f418838559e026f1bdbbf81a30949b6 (patch)
tree86064619f486709e3e12488306502abfd90239d7 /chrome
parentbc0fd965f2578d40e7686b41f6aa1a9fca48fb08 (diff)
downloadchromium_src-7716bfdc8f418838559e026f1bdbbf81a30949b6.zip
chromium_src-7716bfdc8f418838559e026f1bdbbf81a30949b6.tar.gz
chromium_src-7716bfdc8f418838559e026f1bdbbf81a30949b6.tar.bz2
[Mac] Clean up references to parentWindow_ when closing an extension popup.
BUG=40057 TEST=Install aniweather extension. Open popup and Cmd-Q while popup is still open. Should not crash. Review URL: http://codereview.chromium.org/1659009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45052 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/extensions/extension_popup_controller.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/cocoa/extensions/extension_popup_controller.mm
index 0e656b8..1dec941 100644
--- a/chrome/browser/cocoa/extensions/extension_popup_controller.mm
+++ b/chrome/browser/cocoa/extensions/extension_popup_controller.mm
@@ -176,6 +176,14 @@ class DevtoolsNotificationBridge : public NotificationObserver {
- (void)close {
[parentWindow_ removeChildWindow:[self window]];
+
+ // No longer have a parent window, so nil out the pointer and deregister for
+ // notifications.
+ NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
+ [center removeObserver:self
+ name:NSWindowWillCloseNotification
+ object:parentWindow_];
+ parentWindow_ = nil;
[super close];
}