wined3d: Unset the ddraw primary when it is released.

This commit is contained in:
Stefan Dösinger 2006-05-15 20:49:36 +02:00 committed by Alexandre Julliard
parent 2a35f769e3
commit f7d89201c1
1 changed files with 3 additions and 0 deletions

View File

@ -65,6 +65,7 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
ULONG ref = InterlockedDecrement(&This->resource.ref); ULONG ref = InterlockedDecrement(&This->resource.ref);
TRACE("(%p) : Releasing from %ld\n", This, ref + 1); TRACE("(%p) : Releasing from %ld\n", This, ref + 1);
if (ref == 0) { if (ref == 0) {
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->resource.wineD3DDevice;
TRACE("(%p) : cleaning up\n", This); TRACE("(%p) : cleaning up\n", This);
if (This->glDescription.textureName != 0) { /* release the openGL texture.. */ if (This->glDescription.textureName != 0) { /* release the openGL texture.. */
ENTER_GL(); ENTER_GL();
@ -84,6 +85,8 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
} }
IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface); IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface);
if(iface == device->ddraw_primary)
device->ddraw_primary = NULL;
TRACE("(%p) Released\n", This); TRACE("(%p) Released\n", This);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);