Commit 4d9b6827 authored by Nancy Wang's avatar Nancy Wang Committed by Chromium LUCI CQ

Fix the ~AppWindowLauncherItemController crash issue.

In ~AppWindowLauncherItemController, AppWindowBase::SetController could
remove the window from windows_, so the for loop for windows_ might
cause crash.

Modify the for loop to use the reverse iterator to resolve the crash
issue.

BUG=1164188

Change-Id: Ifa561df71d3be1daf0c3505e8836d1cb60fa9143
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2633483Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844880}
parent 973fcef0
...@@ -64,9 +64,11 @@ AppWindowLauncherItemController::AppWindowLauncherItemController( ...@@ -64,9 +64,11 @@ AppWindowLauncherItemController::AppWindowLauncherItemController(
: ash::ShelfItemDelegate(shelf_id) {} : ash::ShelfItemDelegate(shelf_id) {}
AppWindowLauncherItemController::~AppWindowLauncherItemController() { AppWindowLauncherItemController::~AppWindowLauncherItemController() {
for (auto* window : windows_) WindowList windows(windows_);
window->SetController(nullptr);
for (auto* window : hidden_windows_) for (auto* window : hidden_windows_)
windows.push_back(window);
for (auto* window : windows)
window->SetController(nullptr); window->SetController(nullptr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment