From 514a30a4f290e598ee7e2b00072fe3dad71cbed1 Mon Sep 17 00:00:00 2001 From: danakj Date: Mon, 29 Sep 2014 11:40:34 -0700 Subject: Store the result of Pass() in a local variable. This makes the use of Pass() similar to how std::move() would be used to make this code act as it should when using unique_ptr. R=sky@chromium.org BUG=418297 Review URL: https://codereview.chromium.org/609083002 Cr-Commit-Position: refs/heads/master@{#297214} --- ash/drag_drop/drag_drop_controller.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ash/drag_drop') diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index 21510e7..4242264 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -557,9 +557,9 @@ void DragDropController::Cleanup() { drag_window_->RemoveObserver(this); drag_window_ = NULL; drag_data_ = NULL; - // Cleanup can be called again while deleting DragDropTracker, so use Pass - // instead of reset to avoid double free. - drag_drop_tracker_.Pass(); + // Cleanup can be called again while deleting DragDropTracker, so delete + // the pointer with a local variable to avoid double free. + scoped_ptr holder = drag_drop_tracker_.Pass(); } } // namespace ash -- cgit v1.1