Stefan Dösinger : wined3d: Release the stateblock before destroying the swapchain.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Aug 16 05:38:32 CDT 2007
Module: wine
Branch: master
Commit: 7ebf3d92b578d70b4073c8d365aea5cfdafb1447
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7ebf3d92b578d70b4073c8d365aea5cfdafb1447
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Tue Aug 14 14:44:41 2007 +0200
wined3d: Release the stateblock before destroying the swapchain.
---
dlls/wined3d/device.c | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index bdc2c94..43d801f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1975,6 +1975,25 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
IWineD3DDevice_SetTexture(iface, WINED3DVERTEXTEXTURESAMPLER0 + sampler, NULL);
}
+ /* Release the update stateblock */
+ if(IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->updateStateBlock) > 0){
+ if(This->updateStateBlock != This->stateBlock)
+ FIXME("(%p) Something's still holding the Update stateblock\n",This);
+ }
+ This->updateStateBlock = NULL;
+
+ { /* because were not doing proper internal refcounts releasing the primary state block
+ causes recursion with the extra checks in ResourceReleased, to avoid this we have
+ to set this->stateBlock = NULL; first */
+ IWineD3DStateBlock *stateBlock = (IWineD3DStateBlock *)This->stateBlock;
+ This->stateBlock = NULL;
+
+ /* Release the stateblock */
+ if(IWineD3DStateBlock_Release(stateBlock) > 0){
+ FIXME("(%p) Something's still holding the Update stateblock\n",This);
+ }
+ }
+
/* Release the buffers (with sanity checks)*/
TRACE("Releasing the depth stencil buffer at %p\n", This->stencilBufferTarget);
if(This->stencilBufferTarget != NULL && (IWineD3DSurface_Release(This->stencilBufferTarget) >0)){
@@ -2008,25 +2027,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
This->swapchains = NULL;
This->NumberOfSwapChains = 0;
- /* Release the update stateblock */
- if(IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->updateStateBlock) > 0){
- if(This->updateStateBlock != This->stateBlock)
- FIXME("(%p) Something's still holding the Update stateblock\n",This);
- }
- This->updateStateBlock = NULL;
-
- { /* because were not doing proper internal refcounts releasing the primary state block
- causes recursion with the extra checks in ResourceReleased, to avoid this we have
- to set this->stateBlock = NULL; first */
- IWineD3DStateBlock *stateBlock = (IWineD3DStateBlock *)This->stateBlock;
- This->stateBlock = NULL;
-
- /* Release the stateblock */
- if(IWineD3DStateBlock_Release(stateBlock) > 0){
- FIXME("(%p) Something's still holding the Update stateblock\n",This);
- }
- }
-
HeapFree(GetProcessHeap(), 0, This->render_targets);
HeapFree(GetProcessHeap(), 0, This->fbo_color_attachments);
HeapFree(GetProcessHeap(), 0, This->draw_buffers);
More information about the wine-cvs
mailing list