Commit a878b0fa authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

d3d9: Fix crash in d3d9_indexbuffer_Release().

parent e6c6be1c
...@@ -402,12 +402,13 @@ static ULONG WINAPI d3d9_indexbuffer_Release(IDirect3DIndexBuffer9 *iface) ...@@ -402,12 +402,13 @@ static ULONG WINAPI d3d9_indexbuffer_Release(IDirect3DIndexBuffer9 *iface)
if (!refcount) if (!refcount)
{ {
struct wined3d_buffer *draw_buffer = buffer->draw_buffer;
IDirect3DDevice9Ex *device = buffer->parent_device; IDirect3DDevice9Ex *device = buffer->parent_device;
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_buffer_decref(buffer->wined3d_buffer); wined3d_buffer_decref(buffer->wined3d_buffer);
if (buffer->draw_buffer) if (draw_buffer)
wined3d_buffer_decref(buffer->draw_buffer); wined3d_buffer_decref(draw_buffer);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ /* Release the device last, as it may cause the device to be destroyed. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment