ddraw: Release interfaces when exiting with error.

This commit is contained in:
Alexander Dorofeyev 2008-02-20 23:03:51 +02:00 committed by Alexandre Julliard
parent 9de210a037
commit 9af59fb7f0
1 changed files with 2 additions and 0 deletions

View File

@ -360,6 +360,7 @@ IDirect3DTextureImpl_Load(IDirect3DTexture2 *iface,
if(ret_value != D3D_OK)
{
ERR("IWineD3DPalette::GetParent failed! This is unexpected\n");
if (pal) IDirectDrawPalette_Release(pal);
LeaveCriticalSection(&ddraw_cs);
return D3DERR_TEXTURE_LOAD_FAILED;
}
@ -371,6 +372,7 @@ IDirect3DTextureImpl_Load(IDirect3DTexture2 *iface,
if (pal == NULL)
{
IDirectDrawPalette_Release(pal_src);
LeaveCriticalSection(&ddraw_cs);
return DDERR_NOPALETTEATTACHED;
}