[PATCH] wined3d: Don't use the old depth-stencil surface after decrementing its ref count

Chris Robinson chris.kcat at gmail.com
Fri Aug 12 01:21:51 CDT 2011


---
 dlls/wined3d/device.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 66f89f1..51a6c39 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5157,8 +5157,6 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st
     device->fb.depth_stencil = depth_stencil;
     if (depth_stencil)
         wined3d_surface_incref(depth_stencil);
-    if (prev)
-        wined3d_surface_decref(prev);
 
     if (!prev != !depth_stencil)
     {
@@ -5172,6 +5170,8 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st
     {
         device_invalidate_state(device, STATE_RENDER(WINED3DRS_DEPTHBIAS));
     }
+    if (prev)
+        wined3d_surface_decref(prev);
 
     device_invalidate_state(device, STATE_FRAMEBUFFER);
 
-- 
1.7.3.4


--nextPart4224221.8C4M7zF7ky--




More information about the wine-patches mailing list