Skip to content

Commit

Permalink
DragController: Clear DragState in DragEnd
Browse files Browse the repository at this point in the history
DragState is a ScriptWrappable which can keep alive JavaScript upon
unified heap garbage collection resulting in a leak of the last Window
that used a drag event. Clear the state when the drag ended.

Bug: 843903, 928781
Change-Id: Id86a1a917fe772f56fb679e1d73ef3453785ce6d
Reviewed-on: https://chromium-review.googlesource.com/c/1456073
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629582}
  • Loading branch information
mlippautz authored and Commit Bot committed Feb 6, 2019
1 parent 196e39c commit 5a47d40
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions third_party/blink/renderer/core/page/drag_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ void DragController::ClearDragCaret() {
void DragController::DragEnded() {
drag_initiator_ = nullptr;
did_initiate_drag_ = false;
drag_state_ = nullptr;
page_->GetDragCaret().Clear();
}

Expand Down

0 comments on commit 5a47d40

Please sign in to comment.