Index: ash/wm/mru_window_tracker.cc |
diff --git a/ash/wm/mru_window_tracker.cc b/ash/wm/mru_window_tracker.cc |
index 4ed9a1df7230add4d26cfe61e7f7828bd220b76a..af703e9aa12aba161aa304b6ce1a30f596b5aa12 100644 |
--- a/ash/wm/mru_window_tracker.cc |
+++ b/ash/wm/mru_window_tracker.cc |
@@ -190,7 +190,10 @@ void MruWindowTracker::OnWindowActivated(aura::Window* gained_active, |
SetActiveWindow(gained_active); |
} |
-void MruWindowTracker::OnWindowDestroying(aura::Window* window) { |
+void MruWindowTracker::OnWindowDestroyed(aura::Window* window) { |
+ // It's possible for OnWindowActivated() to be called after |
+ // OnWindowDestroying(). This means we need to override OnWindowDestroyed() |
+ // else we may end up with a deleted window in |mru_windows_|. |
mru_windows_.remove(window); |
window->RemoveObserver(this); |
} |