Fixed some nasty bugs in drawdib creation/deletion.
This commit is contained in:
parent
2e27f8c930
commit
a2251e285a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue