Index: webkit/support/web_gesture_curve_mock.cc |
diff --git a/webkit/support/web_gesture_curve_mock.cc b/webkit/support/web_gesture_curve_mock.cc |
index 00e635850d2c96987f49662d80d5a3ab1f741021..43fe5cc0ff1e43031c60dee7231223489589e541 100644 |
--- a/webkit/support/web_gesture_curve_mock.cc |
+++ b/webkit/support/web_gesture_curve_mock.cc |
@@ -22,7 +22,9 @@ bool WebGestureCurveMock::apply(double time, |
WebKit::WebSize displacement(velocity_.x * time, velocity_.y * time); |
WebKit::WebPoint increment(displacement.width - cumulative_scroll_.width, |
displacement.height - cumulative_scroll_.height); |
- target->scrollBy(increment); |
cumulative_scroll_ = displacement; |
+ // scrollBy() could delete this curve if the animation is over, so don't |
+ // touch any member variables after making that call. |
+ target->scrollBy(increment); |
return true; |
} |