Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(686)

Unified Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 651323002: Fixing a "use after free". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding a unit test for WindowEventDispatcher Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/touchui/touch_selection_controller_impl.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index 36b73d148acb928176352c7c40c2face95fb2c2d..bdc05e877d5d3a58337845b32ce11be0f567c5ce 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -222,8 +222,10 @@ class TouchSelectionControllerImpl::EditingHandleView
}
case ui::ET_GESTURE_SCROLL_END:
case ui::ET_SCROLL_FLING_START:
- widget_->ReleaseCapture();
controller_->SetDraggingHandle(NULL);
+ // ReleaseCapture() is potentially destructive and should be done at
+ // the very end.
+ widget_->ReleaseCapture();
break;
default:
break;
« ui/aura/window_event_dispatcher.cc ('K') | « ui/aura/window_event_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698