* Fix leaking the user and combined screen and user clipping.

* Fix using fScreenAndUserClipping directly in CopyBits() that could crash
  when in fScreenAndUserClipping wasn't used (when there's no user clipping
  for example).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25856 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-06-07 23:49:04 +00:00
parent 3c905d812f
commit ea2bcbf4af
+7 -6
View File
@@ -123,6 +123,8 @@ View::~View()
if (fViewBitmap != NULL) if (fViewBitmap != NULL)
gBitmapManager->DeleteBitmap(fViewBitmap); gBitmapManager->DeleteBitmap(fViewBitmap);
delete fScreenAndUserClipping;
delete fUserClipping;
delete fDrawState; delete fDrawState;
// if (fWindow && this == fWindow->TopView()) // if (fWindow && this == fWindow->TopView())
@@ -1130,12 +1132,11 @@ View::CopyBits(IntRect src, IntRect dst, BRegion& windowContentClipping)
// copy children in the source rect and neither to copy onto // copy children in the source rect and neither to copy onto
// children in the destination rect... // children in the destination rect...
copyRegion->Set((clipping_rect)visibleSrc); copyRegion->Set((clipping_rect)visibleSrc);
copyRegion->IntersectWith(&ScreenAndUserClipping(&windowContentClipping)); BRegion *screenAndUserClipping
// note that fScreenAndUserClipping is used directly from hereon = &ScreenAndUserClipping(&windowContentClipping);
// because it is now up to date copyRegion->IntersectWith(screenAndUserClipping);
copyRegion->OffsetBy(-xOffset, -yOffset); copyRegion->OffsetBy(-xOffset, -yOffset);
copyRegion->IntersectWith(fScreenAndUserClipping); copyRegion->IntersectWith(screenAndUserClipping);
// do the actual blit // do the actual blit
fWindow->CopyContents(copyRegion, xOffset, yOffset); fWindow->CopyContents(copyRegion, xOffset, yOffset);
@@ -1157,7 +1158,7 @@ View::CopyBits(IntRect src, IntRect dst, BRegion& windowContentClipping)
// exclude the part that we could copy // exclude the part that we could copy
dirty->Exclude(copyRegion); dirty->Exclude(copyRegion);
dirty->IntersectWith(fScreenAndUserClipping); dirty->IntersectWith(screenAndUserClipping);
fWindow->MarkContentDirty(*dirty); fWindow->MarkContentDirty(*dirty);
fWindow->RecycleRegion(dirty); fWindow->RecycleRegion(dirty);