gdiplus: Clean up HRGN when GdipGetRegionBounds succeeds too.

This commit is contained in:
Vincent Povirk 2011-03-21 10:39:59 -05:00 committed by Alexandre Julliard
parent 296b67f556
commit 42d1d9e9e0
1 changed files with 9 additions and 8 deletions

View File

@ -683,17 +683,18 @@ GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics,
return Ok; return Ok;
} }
if(!GetRgnBox(hrgn, &r)){ if(GetRgnBox(hrgn, &r)){
DeleteObject(hrgn); rect->X = r.left;
return GenericError; rect->Y = r.top;
rect->Width = r.right - r.left;
rect->Height = r.bottom - r.top;
} }
else
status = GenericError;
rect->X = r.left; DeleteObject(hrgn);
rect->Y = r.top;
rect->Width = r.right - r.left;
rect->Height = r.bottom - r.top;
return Ok; return status;
} }
/***************************************************************************** /*****************************************************************************