Fixing leak caused by bug 457864
authorMarkus Stange <mstange@themasta.com>
Sat, 01 Nov 2008 17:12:57 +0100
changeset 21175 9f4dddb8d5f3297abfb611c58e8ff228098e8e2c
parent 21174 5b609dfce6c9e55b7d23e671efc5750c80cd8097
child 21176 a59bd50cd9c8ac9c1326badf78828c0684ae5946
push id3379
push usermstange@themasta.com
push dateSat, 01 Nov 2008 16:13:48 +0000
treeherdermozilla-central@9f4dddb8d5f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs457864
milestone1.9.1b2pre
Fixing leak caused by bug 457864
view/src/nsScrollPortView.cpp
--- a/view/src/nsScrollPortView.cpp
+++ b/view/src/nsScrollPortView.cpp
@@ -263,19 +263,21 @@ NS_IMETHODIMP nsScrollPortView::ScrollTo
     return ScrollToImpl(mDestinationX, mDestinationY);
   }
 
   PRInt32 currentVelocityX = 0;
   PRInt32 currentVelocityY = 0;
   PRBool isSmoothScroll = (aUpdateFlags & NS_VMREFRESH_SMOOTHSCROLL) &&
                           IsSmoothScrollingEnabled();
 
-  if (mAsyncScroll && mAsyncScroll->mIsSmoothScroll) {
-    currentVelocityX = mAsyncScroll->mVelocities[mAsyncScroll->mFrameIndex*2];
-    currentVelocityY = mAsyncScroll->mVelocities[mAsyncScroll->mFrameIndex*2 + 1];
+  if (mAsyncScroll) {
+    if (mAsyncScroll->mIsSmoothScroll) {
+      currentVelocityX = mAsyncScroll->mVelocities[mAsyncScroll->mFrameIndex*2];
+      currentVelocityY = mAsyncScroll->mVelocities[mAsyncScroll->mFrameIndex*2 + 1];
+    }
   } else {
     mAsyncScroll = new AsyncScroll;
     if (mAsyncScroll) {
       mAsyncScroll->mScrollTimer = do_CreateInstance("@mozilla.org/timer;1");
       if (!mAsyncScroll->mScrollTimer) {
         delete mAsyncScroll;
         mAsyncScroll = nsnull;
       }