diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 17:01:12 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 17:01:12 +0000 |
commit | 811535706fde2a2c0472da449ec1a45a109b50ad (patch) | |
tree | d4fe53412aec09ba6e410659616b30fcde7b9f7a | |
parent | 34976af3e937d0a8e61657e1ad6bf734b4edf97e (diff) | |
download | chromium_src-811535706fde2a2c0472da449ec1a45a109b50ad.zip chromium_src-811535706fde2a2c0472da449ec1a45a109b50ad.tar.gz chromium_src-811535706fde2a2c0472da449ec1a45a109b50ad.tar.bz2 |
Fix bookmark bubble crash.
BUG=http://crbug.com/20131
TEST=see bug; was very specific.
Review URL: http://codereview.chromium.org/173428
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24455 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cocoa/bookmark_bubble_controller.mm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.mm b/chrome/browser/cocoa/bookmark_bubble_controller.mm index 7e9b1e2..6bf928a 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller.mm +++ b/chrome/browser/cocoa/bookmark_bubble_controller.mm @@ -113,6 +113,14 @@ // We are the delegate of our own window so we know when we lose key. // When we lose key status we close, mirroring Windows behaivor. - (void)windowDidResignKey:(NSNotification*)notification { + + // If we get here, we are done with this window and controller. The + // call of close: may destroy us which destroys the window. But the + // window is in the middle of processing resignKeyWindow. We + // retain/autorelease the window to insure it lasts until the end of + // this event. + [[window_ retain] autorelease]; + if ([window_ isVisible]) [self close:self]; } |