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.
oldstable
Henri Verbeet 2009-03-10 09:19:05 +01:00 committed by Alexandre Julliard
parent 57d971121a
commit 954c3e22e1
1 changed files with 16 additions and 3 deletions

View File

@ -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);