Commit de4d067f authored by derat's avatar derat Committed by Commit bot

mojo: Fix crash in example WM when closing window.

Avoid a crash caused by dereferencing an iterator after
erasing it.

BUG=415816

Review URL: https://codereview.chromium.org/580353002

Cr-Commit-Position: refs/heads/master@{#295718}
parent 968b94fa
......@@ -297,8 +297,9 @@ class WindowManager
void CloseWindow(Id view_id) {
WindowVector::iterator iter = GetWindowByViewId(view_id);
DCHECK(iter != windows_.end());
Window* window = *iter;
windows_.erase(iter);
(*iter)->view()->Destroy();
window->view()->Destroy();
}
void ShowKeyboard(Id view_id, const gfx::Rect& bounds) {
......
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