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;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue