Fixed a memory leak.

This commit is contained in:
Francis Beaudet 1999-07-30 18:06:04 +00:00 committed by Alexandre Julliard
parent 4d550350f3
commit 66a44e3c1f
1 changed files with 8 additions and 0 deletions

View File

@ -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;
} }