Author: tkreuzer
Date: Sun May 27 17:21:44 2007
New Revision: 26921
URL:
http://svn.reactos.org/svn/reactos?rev=26921&view=rev
Log:
- fix a region leak
- unlock bitmap
Modified:
trunk/reactos/subsystems/win32/win32k/objects/region.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/region.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/region.c Sun May 27 17:21:44 2007
@@ -2531,16 +2531,18 @@
if( !dc )
return FALSE;
- if(!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0))){
- DC_UnlockDc( dc );
- return FALSE;
+ if(!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0)))
+ {
+ DC_UnlockDc( dc );
+ return FALSE;
}
/* ei enable later
// Transform region into device co-ords
- if(!REGION_LPTODP(hDC, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn, dc->w.DCOrgX,
dc->w.DCOrgY) == ERROR) {
+ if(!REGION_LPTODP(hDC, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn, dc->w.DCOrgX,
dc->w.DCOrgY) == ERROR)
+ {
NtGdiDeleteObject( tmpVisRgn );
- DC_UnlockDc( dc );
+ DC_UnlockDc( dc );
return FALSE;
}
*/
@@ -2552,12 +2554,14 @@
visrgn = RGNDATA_LockRgn(hRgn);
if (visrgn == NULL)
{
- DC_UnlockDc( dc );
+ NtGdiDeleteObject( tmpVisRgn );
+ DC_UnlockDc( dc );
return FALSE;
}
- ClipRegion = IntEngCreateClipRegion (
- visrgn->rdh.nCount, (PRECTL)visrgn->Buffer, (PRECTL)&visrgn->rdh.rcBound
);
+ ClipRegion = IntEngCreateClipRegion(visrgn->rdh.nCount,
+ (PRECTL)visrgn->Buffer,
+ (PRECTL)&visrgn->rdh.rcBound );
ASSERT( ClipRegion );
pBrush = BRUSHOBJ_LockBrush(dc->w.hBrush);
ASSERT(pBrush);
@@ -2569,13 +2573,15 @@
/* FIXME - Handle BitmapObj == NULL !!!! */
bRet = IntEngPaint(&BitmapObj->SurfObj,
- ClipRegion,
- &BrushInst.BrushObject,
- &BrushOrigin,
- 0xFFFF);//FIXME:don't know what to put here
+ ClipRegion,
+ &BrushInst.BrushObject,
+ &BrushOrigin,
+ 0xFFFF);//FIXME:don't know what to put here
BITMAPOBJ_UnlockBitmap(BitmapObj);
+ BRUSHOBJ_UnlockBrush(pBrush);
RGNDATA_UnlockRgn( visrgn );
+ NtGdiDeleteObject( tmpVisRgn );
// Fill the region
DC_UnlockDc( dc );