Fixed some nasty bugs in drawdib creation/deletion.

This commit is contained in:
Eric Pouech 2003-01-02 17:56:07 +00:00 committed by Alexandre Julliard
parent 2e27f8c930
commit a2251e285a
1 changed files with 11 additions and 1 deletions

View File

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