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

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: 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.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index fcb5ac966eade1a8ed9952c9bb8a7e18c24e8d10..c5dae64c6e568cec7f11122396d44b305ed07f95 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -167,7 +167,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();

Powered by Google App Engine
This is Rietveld 408576698