Kirill K. Smirnov : winhelp: When we reuse window structure, old brush should not be reused.

Alexandre Julliard julliard at winehq.org
Fri Dec 21 07:28:25 CST 2007


Module: wine
Branch: master
Commit: 72c5aea60063f7126b3c9594c1d018ee215dd8a1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=72c5aea60063f7126b3c9594c1d018ee215dd8a1

Author: Kirill K. Smirnov <lich at math.spbu.ru>
Date:   Thu Dec 20 20:37:03 2007 +0300

winhelp: When we reuse window structure, old brush should not be reused.

---

 programs/winhelp/winhelp.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c
index ab4999b..f92a12c 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);




More information about the wine-cvs mailing list