clean up a couple of leaks

This commit is contained in:
blizzard%redhat.com 1999-08-30 00:43:08 +00:00
parent 055643445e
commit 3998e0c126
2 changed files with 6 additions and 20 deletions

View File

@ -79,8 +79,10 @@ nsRegionXlib::SetTo(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
r.height = aHeight;
Region nRegion = ::XCreateRegion();
::XUnionRectWithRegion(&r, mRegion, nRegion);
Region tRegion = ::XCreateRegion();
::XUnionRectWithRegion(&r, tRegion, nRegion);
::XDestroyRegion(mRegion);
::XDestroyRegion(tRegion);
mRegion = nRegion;
}

View File

@ -480,26 +480,10 @@ nsRenderingContextXlib::GetClipRegion(nsIRegion **aRegion)
NS_ASSERTION(!(nsnull == aRegion), "no region ptr");
if (nsnull == *aRegion) {
nsRegionXlib *rgn = new nsRegionXlib();
if (nsnull != rgn) {
NS_ADDREF(rgn);
rv = rgn->Init();
if (NS_OK == rv)
*aRegion = rgn;
else
NS_RELEASE(rgn);
}
else
rv = NS_ERROR_OUT_OF_MEMORY;
if (*aRegion) {
nsIRegion *nRegion = (nsIRegion *)mClipRegion;
(*aRegion)->SetTo(*nRegion);
}
if (rv == NS_OK)
(*aRegion)->SetTo(*mClipRegion);
return rv;
}