From: Henri Verbeet Subject: [PATCH 2/5] wined3d: Do not increment the reference count of the returned buffer in wined3d_device_get_stream_source(). Message-Id: <1411030589-11210-2-git-send-email-hverbeet@codeweavers.com> Date: Thu, 18 Sep 2014 10:56:26 +0200 None of the other getters increment the reference count either. --- dlls/d3d8/device.c | 1 - dlls/d3d9/device.c | 1 - dlls/ddraw/vertexbuffer.c | 2 -- dlls/wined3d/device.c | 2 -- 4 files changed, 6 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 429b30c..2e74a41 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2798,7 +2798,6 @@ static HRESULT WINAPI d3d8_device_GetStreamSource(IDirect3DDevice8 *iface, buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); *buffer = &buffer_impl->IDirect3DVertexBuffer8_iface; IDirect3DVertexBuffer8_AddRef(*buffer); - wined3d_buffer_decref(wined3d_buffer); } else { diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 7b9b635..a40a6a1 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2769,7 +2769,6 @@ static HRESULT WINAPI d3d9_device_GetStreamSource(IDirect3DDevice9Ex *iface, buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); *buffer = &buffer_impl->IDirect3DVertexBuffer9_iface; IDirect3DVertexBuffer9_AddRef(*buffer); - wined3d_buffer_decref(wined3d_buffer); } else { diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index 5d77790..0f06fe5 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -159,8 +159,6 @@ static ULONG WINAPI d3d_vertex_buffer7_Release(IDirect3DVertexBuffer7 *iface) 0, &curVB, &offset, &stride); if (curVB == buffer->wineD3DVertexBuffer) wined3d_device_set_stream_source(buffer->ddraw->wined3d_device, 0, NULL, 0, 0); - if (curVB) - wined3d_buffer_decref(curVB); /* For the GetStreamSource */ wined3d_vertex_declaration_decref(buffer->wineD3DVertexDeclaration); wined3d_buffer_decref(buffer->wineD3DVertexBuffer); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b9a0954..cbdf509 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1276,8 +1276,6 @@ HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *devi stream = &device->state.streams[stream_idx]; *buffer = stream->buffer; - if (*buffer) - wined3d_buffer_incref(*buffer); if (offset) *offset = stream->offset; *stride = stream->stride; -- 1.7.10.4