ddraw: Clear attached_iface before releasing it in ddraw_surface_delete_attached_surface().

Spotted by Dan Kegel / Valgrind.
This commit is contained in:
Henri Verbeet 2011-10-18 20:46:12 +02:00 committed by Alexandre Julliard
parent 10b54a7860
commit 4408c5abc6
1 changed files with 5 additions and 1 deletions

View File

@ -1590,8 +1590,12 @@ static HRESULT ddraw_surface_delete_attached_surface(IDirectDrawSurfaceImpl *Thi
IDirect3DDeviceImpl_UpdateDepthStencil(This->ddraw->d3ddevice);
}
LeaveCriticalSection(&ddraw_cs);
IUnknown_Release(Surf->attached_iface);
/* Set attached_iface to NULL before releasing it, the surface may go
* away. */
Surf->attached_iface = NULL;
IUnknown_Release(detach_iface);
return DD_OK;
}