Fixed a memory leak.
This commit is contained in:
parent
4d550350f3
commit
66a44e3c1f
|
@ -798,7 +798,10 @@ static void TAB_DrawItem(
|
||||||
* Background color.
|
* Background color.
|
||||||
*/
|
*/
|
||||||
if (!(lStyle & TCS_OWNERDRAWFIXED))
|
if (!(lStyle & TCS_OWNERDRAWFIXED))
|
||||||
|
{
|
||||||
|
DeleteObject(hbr);
|
||||||
hbr = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));
|
hbr = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Erase the background.
|
* Erase the background.
|
||||||
|
@ -847,6 +850,7 @@ static void TAB_DrawItem(
|
||||||
/*
|
/*
|
||||||
* Background color.
|
* Background color.
|
||||||
*/
|
*/
|
||||||
|
DeleteObject(hbr);
|
||||||
hbr = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
|
hbr = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -961,6 +965,8 @@ static void TAB_DrawItem(
|
||||||
*/
|
*/
|
||||||
SetBkMode(hdc, oldBkMode);
|
SetBkMode(hdc, oldBkMode);
|
||||||
SelectObject(hdc, holdPen);
|
SelectObject(hdc, holdPen);
|
||||||
|
DeleteObject(hfocusPen);
|
||||||
|
DeleteObject(hbr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1097,6 +1103,8 @@ static LRESULT TAB_EraseBackground(
|
||||||
if (givenDC==0)
|
if (givenDC==0)
|
||||||
ReleaseDC(hwnd, hdc);
|
ReleaseDC(hwnd, hdc);
|
||||||
|
|
||||||
|
DeleteObject(brush);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue