ddraw: Check if the ddraw object still exists in d3d_device_inner_Release() (Valgrind).
This commit is contained in:
parent
4a416f8d37
commit
4c5276042d
|
@ -435,6 +435,9 @@ static void ddraw_destroy(struct ddraw *This)
|
|||
wined3d_device_decref(This->wined3d_device);
|
||||
wined3d_decref(This->wined3d);
|
||||
|
||||
if (This->d3ddevice)
|
||||
This->d3ddevice->ddraw = NULL;
|
||||
|
||||
/* Now free the object */
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
|
|
@ -316,7 +316,10 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
|
|||
IUnknown_Release(rt_iface);
|
||||
TRACE("Render target release done.\n");
|
||||
|
||||
This->ddraw->d3ddevice = NULL;
|
||||
/* Releasing the render target above may have released the last
|
||||
* reference to the ddraw object. */
|
||||
if (This->ddraw)
|
||||
This->ddraw->d3ddevice = NULL;
|
||||
|
||||
/* Now free the structure */
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
|
|
Loading…
Reference in New Issue