Commit 41a76b95 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9: Add some missing locking to IDirect3DDevice9Impl_EndStateBlock().

Found by Michael Stefaniuc & Coccinelle.
parent 14b063a1
......@@ -1551,7 +1551,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_EndStateBlock(IDirect3DDevice9Ex *ifa
if (!object)
{
ERR("Failed to allocate stateblock memory.\n");
wined3d_mutex_lock();
IWineD3DStateBlock_Release(wined3d_stateblock);
wined3d_mutex_unlock();
return E_OUTOFMEMORY;
}
......@@ -1559,7 +1561,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_EndStateBlock(IDirect3DDevice9Ex *ifa
if (FAILED(hr))
{
WARN("Failed to initialize stateblock, hr %#x.\n", hr);
wined3d_mutex_lock();
IWineD3DStateBlock_Release(wined3d_stateblock);
wined3d_mutex_unlock();
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
......
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