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

This commit is contained in:
Eric Pouech 2010-06-12 21:55:05 +02:00 committed by Alexandre Julliard
parent 2d20a1aa53
commit 3b07c851f8

View file

@ -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)