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

Unified Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 2090003002: MacViews: Explicitly release mouse capture in BridgedNativeWidget::OnWindowWillClose(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | ui/views/widget/widget_unittest.cc » ('j') | ui/views/widget/widget_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_native_widget.mm
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm
index 47373d0d4a973470d3ddc37c590af7672d842173..c54bcc32a1023532bf4634a4486ec89890649b62 100644
--- a/ui/views/cocoa/bridged_native_widget.mm
+++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -366,7 +366,10 @@ BridgedNativeWidget::~BridgedNativeWidget() {
[window_ setDelegate:nil];
close_window = true;
}
-
+ // If we have capture, we'll get a OnMouseCaptureLost callback, which can
tapted 2016/06/23 02:26:28 nit: it's generally good to avoid "we". (there's e
karandeepb 2016/06/23 07:58:32 Done.
+ // lead to a use after free crash. Hence explicitly release capture. See
+ // crbug.com/622201.
+ ReleaseCapture();
tapted 2016/06/23 02:26:28 DesktopNativeWidgetAura does it in OnHostClosed, w
karandeepb 2016/06/23 07:58:32 Yes Widget::OnMouseCaptureLost is invoked for aura
karandeepb 2016/06/24 05:34:36 Done.
RemoveOrDestroyChildren();
DCHECK(child_windows_.empty());
SetFocusManager(nullptr);
« no previous file with comments | « no previous file | ui/views/widget/widget_unittest.cc » ('j') | ui/views/widget/widget_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698