mirror of
https://github.com/reactos/wine.git
synced 2024-12-02 00:36:43 +00:00
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.
This commit is contained in:
parent
57d971121a
commit
954c3e22e1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user