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

Unified Diff: ui/aura/window_observer.h

Issue 101013002: Make sure WindowObservers are removed from window before destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 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: ui/aura/window_observer.h
diff --git a/ui/aura/window_observer.h b/ui/aura/window_observer.h
index 5008ac514d50724cc1b924c07609e8ca015459dd..7b6939d4ac4b6e2fc4a83d9c676290c30eba8456 100644
--- a/ui/aura/window_observer.h
+++ b/ui/aura/window_observer.h
@@ -87,8 +87,15 @@ class AURA_EXPORT WindowObserver {
// destructor). This is called before the window is removed from its parent.
virtual void OnWindowDestroying(Window* window) {}
- // Invoked when the Window has been destroyed (i.e. at the end of its
- // destructor). This is called after the window is removed from its parent.
+ // Invoked when the Window has been destroyed (i.e. at the end of
+ // its destructor). This is called after the window is removed from
+ // its parent. Window class automatically removes its
sky 2013/12/05 01:36:35 remove 'class'
oshima 2013/12/05 18:04:01 Done.
+ // WindowObservers before calling this method, so the following code
+ // is no op.
+ //
+ // void MyWindowObserver::OnWindowDestroyed(aura::Window* window) {
+ // window->RemoveObserver(this);
+ // }
virtual void OnWindowDestroyed(Window* window) {}
// Called when a Window has been added to a RootWindow.

Powered by Google App Engine
This is Rietveld 408576698