[PATCH 2/5] wined3d: Keep references to the textures initially captured by CreateStateBlock() as well.

Henri Verbeet hverbeet at codeweavers.com
Tue Oct 6 02:05:54 CDT 2009


---
 dlls/wined3d/stateblock.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index ef33a2a..01783c5 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1648,6 +1648,11 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
             if (stateblock->streamSource[i]) IWineD3DBuffer_AddRef(stateblock->streamSource[i]);
         }
 
+        for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
+        {
+            if (stateblock->textures[i]) IWineD3DBaseTexture_AddRef(stateblock->textures[i]);
+        }
+
         if (stateblock->pIndexData) IWineD3DBuffer_AddRef(stateblock->pIndexData);
         if (stateblock->vertexShader) IWineD3DVertexShader_AddRef(stateblock->vertexShader);
         if (stateblock->pixelShader) IWineD3DPixelShader_AddRef(stateblock->pixelShader);
-- 
1.6.0.6




More information about the wine-patches mailing list