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

Unified Diff: chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm

Issue 1221173003: [Mac] Inform reference counted objects that hold a weak Browser* when the Browser is being destroye… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add HasWeakBrowserPointer protocol. Allow -dealloc without preceding -browserWillBeDestroyed. Created 5 years, 5 months 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/find_bar/find_bar_cocoa_controller.mm
diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
index 14b691b3e49bdb67be302238d566ccad4124586b..795415f90a5d7515e406fcfa995c3b378ffe679a 100644
--- a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
@@ -88,11 +88,16 @@ const float kRightEdgeOffset = 25;
}
- (void)dealloc {
+ [self browserWillBeDestroyed];
erikchen 2015/07/08 18:02:17 I recommended that you make a new method called -c
Robert Sesek 2015/07/08 22:15:18 I kind of agree, but I don't know if adding this e
+ [super dealloc];
+}
+
+- (void)browserWillBeDestroyed {
// All animations should have been explicitly stopped before a tab is closed.
DCHECK(!showHideAnimation_.get());
DCHECK(!moveAnimation_.get());
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [super dealloc];
+ browser_ = nullptr;
}
- (void)setFindBarBridge:(FindBarBridge*)findBarBridge {

Powered by Google App Engine
This is Rietveld 408576698