Commit 3b07c851 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winhelp: Avoid accessing a window in global window list after it has been freed.

parent 2d20a1aa
......@@ -281,24 +281,32 @@ static void CALLBACK MACRO_CheckItem(LPCSTR str)
static void CALLBACK MACRO_CloseSecondarys(void)
{
WINHELP_WINDOW *win;
WINHELP_WINDOW *next;
WINE_TRACE("()\n");
for (win = Globals.win_list; win; win = win->next)
for (win = Globals.win_list; win; win = next)
{
next = win->next;
if (lstrcmpi(win->info->name, "main"))
WINHELP_ReleaseWindow(win);
}
}
static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow)
{
WINHELP_WINDOW *win;
WINHELP_WINDOW *next;
WINE_TRACE("(\"%s\")\n", lpszWindow);
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
for (win = Globals.win_list; win; win = win->next)
for (win = Globals.win_list; win; win = next)
{
next = win->next;
if (!lstrcmpi(win->info->name, lpszWindow))
WINHELP_ReleaseWindow(win);
}
}
static void CALLBACK MACRO_Compare(LPCSTR str)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment