summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index fff947a..fec161a 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1419,11 +1419,14 @@ gfx::Rect RenderViewHost::GetRootWindowResizerRect() const {
void RenderViewHost::ForwardMouseEvent(
const WebKit::WebMouseEvent& mouse_event) {
- RenderWidgetHost::ForwardMouseEvent(mouse_event);
+ // We make a copy of the mouse event because
+ // RenderWidgetHost::ForwardMouseEvent will delete |mouse_event|.
+ WebKit::WebMouseEvent event_copy(mouse_event);
+ RenderWidgetHost::ForwardMouseEvent(event_copy);
RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
if (view) {
- switch (mouse_event.type) {
+ switch (event_copy.type) {
case WebInputEvent::MouseMove:
view->HandleMouseEvent();
break;