gdiplus: Clean up HRGN when GdipGetRegionBounds succeeds too.
This commit is contained in:
parent
296b67f556
commit
42d1d9e9e0
|
@ -683,17 +683,18 @@ GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
if(!GetRgnBox(hrgn, &r)){
|
||||
DeleteObject(hrgn);
|
||||
return GenericError;
|
||||
if(GetRgnBox(hrgn, &r)){
|
||||
rect->X = r.left;
|
||||
rect->Y = r.top;
|
||||
rect->Width = r.right - r.left;
|
||||
rect->Height = r.bottom - r.top;
|
||||
}
|
||||
else
|
||||
status = GenericError;
|
||||
|
||||
rect->X = r.left;
|
||||
rect->Y = r.top;
|
||||
rect->Width = r.right - r.left;
|
||||
rect->Height = r.bottom - r.top;
|
||||
DeleteObject(hrgn);
|
||||
|
||||
return Ok;
|
||||
return status;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
Loading…
Reference in New Issue