Commit 514a30a4 authored by danakj's avatar danakj Committed by Commit bot

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}
parent 7d56ae7a
......@@ -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<ash::DragDropTracker> holder = drag_drop_tracker_.Pass();
}
} // namespace ash
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