From 72c5aea60063f7126b3c9594c1d018ee215dd8a1 Mon Sep 17 00:00:00 2001 From: "Kirill K. Smirnov" Date: Thu, 20 Dec 2007 20:37:03 +0300 Subject: [PATCH] winhelp: When we reuse window structure, old brush should not be reused. --- programs/winhelp/winhelp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index ab4999b4bd0..f92a12c7c45 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -463,8 +463,8 @@ static BOOL WINHELP_ReuseWindow(WINHELP_WINDOW* win, WINHELP_WINDOW* oldwin, win->hButtonBoxWnd = oldwin->hButtonBoxWnd; win->hTextWnd = oldwin->hTextWnd; win->hHistoryWnd = oldwin->hHistoryWnd; - oldwin->hMainWnd = oldwin->hButtonBoxWnd = oldwin->hTextWnd = oldwin->hHistoryWnd = 0; - win->hBrush = oldwin->hBrush; + oldwin->hMainWnd = oldwin->hButtonBoxWnd = oldwin->hTextWnd = oldwin->hHistoryWnd = 0; + win->hBrush = CreateSolidBrush(win->info->sr_color); SetWindowLong(win->hMainWnd, 0, (LONG)win); SetWindowLong(win->hButtonBoxWnd, 0, (LONG)win); @@ -1253,7 +1253,6 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, if (hWnd == Globals.hPopupWnd) Globals.hPopupWnd = 0; bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main")); - DeleteObject(win->hBrush); WINHELP_DeleteWindow(win); @@ -1834,6 +1833,8 @@ static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) if (win->hShadowWnd) DestroyWindow(win->hShadowWnd); if (win->hHistoryWnd) DestroyWindow(win->hHistoryWnd); + DeleteObject(win->hBrush); + for (i = 0; i < win->histIndex; i++) { HLPFILE_FreeHlpFile(win->history[i]->file); -- 2.11.4.GIT