From 237f49d5b5b900e32147eb95ee5faa2e2661be1d Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Sat, 1 Nov 2008 17:12:57 +0100 Subject: [PATCH] Fixing leak caused by bug 457864 --- view/src/nsScrollPortView.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/view/src/nsScrollPortView.cpp b/view/src/nsScrollPortView.cpp index e905fc7f762..8872f007905 100644 --- a/view/src/nsScrollPortView.cpp +++ b/view/src/nsScrollPortView.cpp @@ -268,9 +268,11 @@ NS_IMETHODIMP nsScrollPortView::ScrollTo(nscoord aDestinationX, nscoord aDestina 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) {