Commit a2251e28 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed some nasty bugs in drawdib creation/deletion.

parent 2e27f8c9
......@@ -64,7 +64,7 @@ static WINE_HDD* MSVIDEO_GetHddPtr(HDRAWDIB hd)
{
WINE_HDD* hdd;
for (hdd = HDD_FirstHdd; hdd != NULL && hdd->hSelf != hdd; hdd = hdd->next);
for (hdd = HDD_FirstHdd; hdd != NULL && hdd->hSelf != hd; hdd = hdd->next);
return hdd;
}
......@@ -97,6 +97,7 @@ HDRAWDIB VFWAPI DrawDibOpen(void)
BOOL VFWAPI DrawDibClose(HDRAWDIB hdd)
{
WINE_HDD* whdd = MSVIDEO_GetHddPtr(hdd);
WINE_HDD** p;
TRACE("(%p)\n", hdd);
......@@ -104,6 +105,15 @@ BOOL VFWAPI DrawDibClose(HDRAWDIB hdd)
if (whdd->begun) DrawDibEnd(hdd);
for (p = &HDD_FirstHdd; *p != NULL; p = &((*p)->next))
{
if (*p == whdd)
{
*p = whdd->next;
break;
}
}
HeapFree(GetProcessHeap(), 0, whdd);
return TRUE;
......
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