d3d9: Don't grab wined3d lock for wined3d incref/decref functions.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
00824a94f0
commit
08c9b7c9ce
|
@ -2553,9 +2553,7 @@ static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDire
|
|||
|
||||
if (!(object = heap_alloc_zero(sizeof(*object))))
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
wined3d_stateblock_decref(wined3d_stateblock);
|
||||
wined3d_mutex_unlock();
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
|
@ -2563,9 +2561,7 @@ static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDire
|
|||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize stateblock, hr %#x.\n", hr);
|
||||
wined3d_mutex_lock();
|
||||
wined3d_stateblock_decref(wined3d_stateblock);
|
||||
wined3d_mutex_unlock();
|
||||
heap_free(object);
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -81,9 +81,7 @@ static ULONG WINAPI d3d9_Release(IDirect3D9Ex *iface)
|
|||
|
||||
if (!refcount)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
wined3d_decref(d3d9->wined3d);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
heap_free(d3d9->wined3d_outputs);
|
||||
heap_free(d3d9);
|
||||
|
|
|
@ -76,10 +76,7 @@ static ULONG WINAPI d3d9_query_Release(IDirect3DQuery9 *iface)
|
|||
|
||||
if (!refcount)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
wined3d_query_decref(query->wined3d_query);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IDirect3DDevice9Ex_Release(query->parent_device);
|
||||
heap_free(query);
|
||||
}
|
||||
|
|
|
@ -54,9 +54,7 @@ static ULONG WINAPI d3d9_vertexshader_AddRef(IDirect3DVertexShader9 *iface)
|
|||
if (refcount == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(shader->parent_device);
|
||||
wined3d_mutex_lock();
|
||||
wined3d_shader_incref(shader->wined3d_shader);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return refcount;
|
||||
|
@ -72,11 +70,7 @@ static ULONG WINAPI d3d9_vertexshader_Release(IDirect3DVertexShader9 *iface)
|
|||
if (!refcount)
|
||||
{
|
||||
IDirect3DDevice9Ex *device = shader->parent_device;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_shader_decref(shader->wined3d_shader);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
IDirect3DDevice9Ex_Release(device);
|
||||
}
|
||||
|
@ -203,9 +197,7 @@ static ULONG WINAPI d3d9_pixelshader_AddRef(IDirect3DPixelShader9 *iface)
|
|||
if (refcount == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(shader->parent_device);
|
||||
wined3d_mutex_lock();
|
||||
wined3d_shader_incref(shader->wined3d_shader);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return refcount;
|
||||
|
@ -221,11 +213,7 @@ static ULONG WINAPI d3d9_pixelshader_Release(IDirect3DPixelShader9 *iface)
|
|||
if (!refcount)
|
||||
{
|
||||
IDirect3DDevice9Ex *device = shader->parent_device;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_shader_decref(shader->wined3d_shader);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
IDirect3DDevice9Ex_Release(device);
|
||||
}
|
||||
|
|
|
@ -66,9 +66,7 @@ static ULONG WINAPI d3d9_stateblock_Release(IDirect3DStateBlock9 *iface)
|
|||
|
||||
if (!refcount)
|
||||
{
|
||||
wined3d_mutex_lock();
|
||||
wined3d_stateblock_decref(stateblock->wined3d_stateblock);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
IDirect3DDevice9Ex_Release(stateblock->parent_device);
|
||||
heap_free(stateblock);
|
||||
|
|
|
@ -225,9 +225,7 @@ static ULONG WINAPI d3d9_vertex_declaration_AddRef(IDirect3DVertexDeclaration9 *
|
|||
if (refcount == 1)
|
||||
{
|
||||
IDirect3DDevice9Ex_AddRef(declaration->parent_device);
|
||||
wined3d_mutex_lock();
|
||||
wined3d_vertex_declaration_incref(declaration->wined3d_declaration);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
return refcount;
|
||||
|
@ -243,9 +241,7 @@ static ULONG WINAPI d3d9_vertex_declaration_Release(IDirect3DVertexDeclaration9
|
|||
if (!refcount)
|
||||
{
|
||||
IDirect3DDevice9Ex *parent_device = declaration->parent_device;
|
||||
wined3d_mutex_lock();
|
||||
wined3d_vertex_declaration_decref(declaration->wined3d_declaration);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
IDirect3DDevice9Ex_Release(parent_device);
|
||||
|
|
Loading…
Reference in New Issue