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

This commit is contained in:
Chris Robinson 2011-08-11 23:21:51 -07:00 committed by Alexandre Julliard
parent 4cdd01fc82
commit 342d2b8979
1 changed files with 2 additions and 2 deletions

View File

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