Henri Verbeet : wined3d: Set the depth/ stencil buffer to NULL before releasing it.
Alexandre Julliard
julliard at winehq.org
Tue Oct 5 12:03:11 CDT 2010
Module: wine
Branch: master
Commit: e1b96eb3475d298fb1e4f7b137a6c73bb6dc16df
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e1b96eb3475d298fb1e4f7b137a6c73bb6dc16df
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue Oct 5 14:32:36 2010 +0200
wined3d: Set the depth/stencil buffer to NULL before releasing it.
To prevent device_resource_released() from detecting it as still in use.
---
dlls/wined3d/device.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 1e42409..7b2b8ce 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2107,13 +2107,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
This->onscreen_depth_stencil = NULL;
}
- TRACE("Releasing the depth stencil buffer at %p\n", This->depth_stencil);
- if (This->depth_stencil && IWineD3DSurface_Release((IWineD3DSurface *)This->depth_stencil))
+ if (This->depth_stencil)
{
- if (This->auto_depth_stencil != This->depth_stencil)
- FIXME("(%p) Something is still holding the depth/stencil buffer.\n",This);
+ IWineD3DSurfaceImpl *ds = This->depth_stencil;
+
+ TRACE("Releasing depth/stencil buffer %p.\n", ds);
+
+ This->depth_stencil = NULL;
+ if (IWineD3DSurface_Release((IWineD3DSurface *)ds)
+ && ds != This->auto_depth_stencil)
+ {
+ ERR("Something is still holding a reference to depth/stencil buffer %p.\n", ds);
+ }
}
- This->depth_stencil = NULL;
TRACE("Releasing the render target at %p\n", This->render_targets[0]);
IWineD3DSurface_Release((IWineD3DSurface *)This->render_targets[0]);
More information about the wine-cvs
mailing list