Commit 954c3e22 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d8: Don't call Release() in a while loop.

There should only ever be a single reference to these objects, since only their handle is exposed outside d3d8. Should there be more references than that, calling Release() in a while loop probably isn't the right approach.
parent 57d97112
......@@ -1302,7 +1302,12 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DeleteStateBlock(LPDIRECT3DDEVICE8 if
TRACE("(%p) Relay\n", This);
EnterCriticalSection(&d3d8_cs);
while(IUnknown_Release((IUnknown *)pSB));
if (IUnknown_Release((IUnknown *)pSB))
{
ERR("Stateblock %p has references left, this shouldn't happen.\n", pSB);
}
LeaveCriticalSection(&d3d8_cs);
return D3D_OK;
......@@ -1910,7 +1915,11 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DeleteVertexShader(LPDIRECT3DDEVICE
IWineD3DVertexShader_Release(cur);
}
while(IUnknown_Release((IUnknown *)shader));
if (IUnknown_Release((IUnknown *)shader))
{
ERR("Shader %p has references left, this shouldn't happen.\n", shader);
}
free_shader_handle(This, handle);
}
LeaveCriticalSection(&d3d8_cs);
......@@ -2164,7 +2173,11 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(LPDIRECT3DDEVICE8 i
IWineD3DPixelShader_Release(cur);
}
while(IUnknown_Release((IUnknown *)shader));
if (IUnknown_Release((IUnknown *)shader))
{
ERR("Shader %p has references left, this shouldn't happen.\n", shader);
}
free_shader_handle(This, handle);
}
LeaveCriticalSection(&d3d8_cs);
......
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