Index: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc |
index d81aeb84a9b4c8d70f7811cdd61d019d2a58f52e..63f6be3f504a3bb56f16ee703610531b23a44bd3 100644 |
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc |
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc |
@@ -765,9 +765,14 @@ bool DesktopRootWindowHostWin::HandleUntranslatedKeyEvent( |
OnHostKeyEvent(duplicate_event.get()); |
} |
-bool DesktopRootWindowHostWin::HandleTouchEvent( |
+void DesktopRootWindowHostWin::HandleTouchEvent( |
const ui::TouchEvent& event) { |
- return root_window_host_delegate_->OnHostTouchEvent( |
+ // HWNDMessageHandler asynchronously processes touch events. Because of this |
+ // it's possible for the aura::RootWindow to have been destroyed by the time |
+ // we attempt to process them. |
+ if (!GetWidget()->GetNativeView()) |
+ return; |
+ root_window_host_delegate_->OnHostTouchEvent( |
const_cast<ui::TouchEvent*>(&event)); |
} |