Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2431)

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

Issue 2567973002: Mac: Fix lifetime problem under BookmarkBarController stopPulsingBookmarkNode. (Closed)
Patch Set: Guarantee a crash Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index 51c7bcef96c1527c523ac8ca24a8555cacd37928..d3b2c4f17e5c88706ad9fe381ef222d27458600b 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -361,7 +361,8 @@ void RecordAppLaunch(Profile* profile, GURL url) {
- (void)startPulsingBookmarkNode:(const BookmarkNode*)node {
[self stopPulsingBookmarkNode];
- pulsingButton_ = [self bookmarkButtonToPulseForNode:node];
+ pulsingButton_.reset([self bookmarkButtonToPulseForNode:node],
+ base::scoped_policy::RETAIN);
if (!pulsingButton_)
return;
@@ -379,7 +380,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
return;
[pulsingButton_ setPulseIsStuckOn:NO];
- pulsingButton_ = nil;
+ pulsingButton_.reset();
pulsingBookmarkObserver_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698