Chris Robinson : wined3d: Don' t use the old depth-stencil surface after decrementing its ref count.

Alexandre Julliard julliard at winehq.org
Mon Aug 22 13:29:14 CDT 2011


Module: wine
Branch: master
Commit: 342d2b8979fbe71aa0bf52717a0b1b9e1a3b6150
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=342d2b8979fbe71aa0bf52717a0b1b9e1a3b6150

Author: Chris Robinson <chris.kcat at gmail.com>
Date:   Thu Aug 11 23:21:51 2011 -0700

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

---

 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);
 




More information about the wine-cvs mailing list