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

Unified Diff: ui/aura/window.cc

Issue 101013002: Make sure WindowObservers are removed from window before destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix shutdown order 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
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 692e345753bfe0f9e8366b3f350294e1377ac7b5..2655b8a0eb7d4dc6283ec5ec990052c76a5bd693 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -168,7 +168,12 @@ Window::~Window() {
// Delegate and observers need to be notified after transients are deleted.
if (delegate_)
delegate_->OnWindowDestroyed();
- FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this));
+ ObserverListBase<WindowObserver>::Iterator iter(observers_);
+ WindowObserver* observer;
+ while ((observer = iter.GetNext())) {
+ RemoveObserver(observer);
+ observer->OnWindowDestroyed(this);
+ }
// Clear properties.
for (std::map<const void*, Value>::const_iterator iter = prop_map_.begin();
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698