mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
clean up a couple of leaks
This commit is contained in:
parent
055643445e
commit
3998e0c126
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user