Bug 400208. Don't leak mScrollCnt when we take an early exit from UpdateViewAfterScroll. r+sr=bzbarsky,a=beltzner

This commit is contained in:
roc+@cs.cmu.edu 2007-10-24 14:44:37 -07:00
parent 4b80cff404
commit a69e97ef2b

View File

@ -728,6 +728,8 @@ nsViewManager::UpdateViewAfterScroll(nsView *aView, const nsRegion& aUpdateRegio
// in which case we don't need to worry about invalidating the clipped-out part.
nsRect damageRect = aView->GetDimensions();
if (damageRect.IsEmpty()) {
// Don't forget to undo mScrollCnt!
--RootViewManager()->mScrollCnt;
return;
}
nsPoint offset = ComputeViewOffset(aView);
@ -736,6 +738,8 @@ nsViewManager::UpdateViewAfterScroll(nsView *aView, const nsRegion& aUpdateRegio
// if this is a floating view, it isn't covered by any widgets other than
// its children, which are handled by the widget scroller.
if (aView->GetFloating()) {
// Don't forget to undo mScrollCnt!
--RootViewManager()->mScrollCnt;
return;
}