mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 23:21:23 +00:00
fix region leak
svn path=/trunk/; revision=26920
This commit is contained in:
parent
b476f82321
commit
6e719efbe9
1 changed files with 9 additions and 2 deletions
|
@ -166,27 +166,34 @@ IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
|
||||||
Window->UpdateRegion != (HRGN)1)
|
Window->UpdateRegion != (HRGN)1)
|
||||||
{
|
{
|
||||||
hRgnNonClient = NtGdiCreateRectRgn(0, 0, 0, 0);
|
hRgnNonClient = NtGdiCreateRectRgn(0, 0, 0, 0);
|
||||||
hRgnWindow = IntCalcWindowRgn(Window, TRUE);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If region creation fails it's safe to fallback to whole
|
* If region creation fails it's safe to fallback to whole
|
||||||
* window region.
|
* window region.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (hRgnNonClient == NULL)
|
if (hRgnNonClient == NULL)
|
||||||
{
|
{
|
||||||
return (HRGN)1;
|
return (HRGN)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hRgnWindow = IntCalcWindowRgn(Window, TRUE);
|
||||||
|
if (hRgnWindow == NULL)
|
||||||
|
{
|
||||||
|
NtGdiDeleteObject(hRgnNonClient);
|
||||||
|
return (HRGN)1;
|
||||||
|
}
|
||||||
|
|
||||||
RgnType = NtGdiCombineRgn(hRgnNonClient, Window->UpdateRegion,
|
RgnType = NtGdiCombineRgn(hRgnNonClient, Window->UpdateRegion,
|
||||||
hRgnWindow, RGN_DIFF);
|
hRgnWindow, RGN_DIFF);
|
||||||
if (RgnType == ERROR)
|
if (RgnType == ERROR)
|
||||||
{
|
{
|
||||||
|
NtGdiDeleteObject(hRgnWindow);
|
||||||
NtGdiDeleteObject(hRgnNonClient);
|
NtGdiDeleteObject(hRgnNonClient);
|
||||||
return (HRGN)1;
|
return (HRGN)1;
|
||||||
}
|
}
|
||||||
else if (RgnType == NULLREGION)
|
else if (RgnType == NULLREGION)
|
||||||
{
|
{
|
||||||
|
NtGdiDeleteObject(hRgnWindow);
|
||||||
NtGdiDeleteObject(hRgnNonClient);
|
NtGdiDeleteObject(hRgnNonClient);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue