diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 2b4b6ddeff2..2da80633984 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1487,6 +1487,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetStreamSource(LPDIRECT3DDEVICE8 ifa rc = IWineD3DDevice_GetStreamSource(This->WineD3DDevice, StreamNumber, (IWineD3DVertexBuffer **)&retStream, 0 /* Offset in bytes */, pStride); if (rc == D3D_OK && NULL != retStream) { IWineD3DVertexBuffer_GetParent(retStream, (IUnknown **)pStream); + IWineD3DVertexBuffer_Release(retStream); }else{ FIXME("Call to GetStreamSource failed %p\n", pStride); *pStream = NULL; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index d0a456a6679..62c79c17319 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -789,6 +789,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9 iface, U rc = IWineD3DDevice_GetStreamSource(This->WineD3DDevice, StreamNumber, (IWineD3DVertexBuffer **)&retStream, OffsetInBytes, pStride); if (rc == D3D_OK && NULL != retStream) { IWineD3DVertexBuffer_GetParent(retStream, (IUnknown **)pStream); + IWineD3DVertexBuffer_Release(retStream); }else{ FIXME("Call to GetStreamSource failed %p %p\n", OffsetInBytes, pStride); *pStream = NULL; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 375d57ee329..616cf4c8a30 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2467,6 +2467,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetStreamSource(IWineD3DDevice *iface, return WINED3DERR_INVALIDCALL; } + IWineD3DVertexBuffer_AddRef(*pStream); /* We have created a new reference to the VB */ return WINED3D_OK; }