| Index: ash/wm/toplevel_window_event_handler.cc
|
| diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc
|
| index 067e23875a9b8f5da41b43e5c55c461bbf28c4ca..cfc8ebffc70ae4d1cfa6270e9281e755188411f0 100644
|
| --- a/ash/wm/toplevel_window_event_handler.cc
|
| +++ b/ash/wm/toplevel_window_event_handler.cc
|
| @@ -14,6 +14,7 @@
|
| #include "ui/aura/env.h"
|
| #include "ui/aura/window.h"
|
| #include "ui/aura/window_event_dispatcher.h"
|
| +#include "ui/aura/window_tracker.h"
|
| #include "ui/aura/window_tree_host.h"
|
| #include "ui/base/cursor/cursor.h"
|
| #include "ui/base/hit_test.h"
|
| @@ -94,13 +95,16 @@ aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop(
|
| wm::WindowState* window_state = wm::GetWindowState(source);
|
| const bool window_position_managed = window_state->window_position_managed();
|
| window_state->set_window_position_managed(false);
|
| + aura::WindowTracker tracker({source});
|
|
|
| run_loop.Run();
|
|
|
| if (!weak_ptr)
|
| return aura::client::MOVE_CANCELED;
|
|
|
| - window_state->set_window_position_managed(window_position_managed);
|
| + // Make sure the window hasn't been deleted.
|
| + if (tracker.Contains(source))
|
| + window_state->set_window_position_managed(window_position_managed);
|
|
|
| in_move_loop_ = false;
|
| return result == wm::WmToplevelWindowEventHandler::DragResult::SUCCESS
|
|
|