Index: webkit/glue/fling_animator_impl_android.cc |
diff --git a/webkit/glue/fling_animator_impl_android.cc b/webkit/glue/fling_animator_impl_android.cc |
index b4ba4478160c3fd461925009d79b5ebc45cb805c..bac4e91434cb4b9f343ed9cc7bcd47e414764e94 100644 |
--- a/webkit/glue/fling_animator_impl_android.cc |
+++ b/webkit/glue/fling_animator_impl_android.cc |
@@ -107,9 +107,11 @@ bool FlingAnimatorImpl::apply(double time, |
gfx::Point current_position = GetCurrentPosition(); |
gfx::Vector2d diff(current_position - last_position_); |
+ last_position_ = current_position; |
WebKit::WebPoint scroll_amount(diff.x(), diff.y()); |
+ // scrollBy() could delete this curve if the animation is over, so don't touch |
+ // any member variables after making that call. |
target->scrollBy(scroll_amount); |
- last_position_ = current_position; |
return true; |
} |