mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[COMCTL32] Don't leak memory in PB_ThemedPaint()
CID 1441373
This commit is contained in:
parent
a0c33934fc
commit
3fddd3157c
1 changed files with 4 additions and 0 deletions
|
@ -1841,6 +1841,9 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, Bu
|
||||||
{
|
{
|
||||||
DrawThemeText(theme, hDC, BP_PUSHBUTTON, state, text, lstrlenW(text), dtFlags, 0, &textRect);
|
DrawThemeText(theme, hDC, BP_PUSHBUTTON, state, text, lstrlenW(text), dtFlags, 0, &textRect);
|
||||||
heap_free(text);
|
heap_free(text);
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
text = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (focused)
|
if (focused)
|
||||||
|
@ -1862,6 +1865,7 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, Bu
|
||||||
if (cdrf == CDRF_NOTIFYPOSTPAINT)
|
if (cdrf == CDRF_NOTIFYPOSTPAINT)
|
||||||
BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect);
|
BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect);
|
||||||
cleanup:
|
cleanup:
|
||||||
|
if (text) heap_free(text);
|
||||||
#endif
|
#endif
|
||||||
if (hPrevFont) SelectObject(hDC, hPrevFont);
|
if (hPrevFont) SelectObject(hDC, hPrevFont);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue