| Index: chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
|
| index f97970d7d52e47f8c5473468064d9361e1c2e34a..10b5c8b5911555a1fb011218b68d7473dd2fba2b 100644
|
| --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
|
| @@ -82,17 +82,25 @@ using bookmarks::BookmarkNode;
|
| [self bookmarkModel]->expanded_state_tracker()->GetExpandedNodes()];
|
| }
|
|
|
| +- (void)windowWillClose:(NSNotification*)notification {
|
| + // Force the field editors to resign the first responder so that they'll
|
| + // be removed from the view hierarchy and its delegate be set to nil.
|
| + [[self window] endEditingFor:urlField_];
|
| + [[self window] endEditingFor:nameTextField_];
|
| +
|
| + [super windowWillClose:notification];
|
| +}
|
| +
|
| - (id)windowWillReturnFieldEditor:(NSWindow*)sender toObject:(id)obj {
|
| if (obj == urlField_) {
|
| if (!urlFieldEditor_)
|
| urlFieldEditor_.reset([[DialogTextFieldEditor alloc] init]);
|
| -
|
| - return urlFieldEditor_.autorelease();
|
| + return urlFieldEditor_.get();
|
| } else if (obj == nameTextField_) {
|
| if (!nameFieldEditor_)
|
| nameFieldEditor_.reset([[DialogTextFieldEditor alloc] init]);
|
|
|
| - return nameFieldEditor_.autorelease();
|
| + return nameFieldEditor_.get();
|
| }
|
|
|
| return nil;
|
|
|