Alexander Dorofeyev : ddraw: Release interfaces when exiting with error.

Alexandre Julliard julliard at winehq.org
Thu Feb 21 07:42:27 CST 2008


Module: wine
Branch: master
Commit: 9af59fb7f097e922c51687a3526bcae1a1e84b0b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9af59fb7f097e922c51687a3526bcae1a1e84b0b

Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date:   Wed Feb 20 23:03:51 2008 +0200

ddraw: Release interfaces when exiting with error.

---

 dlls/ddraw/texture.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/ddraw/texture.c b/dlls/ddraw/texture.c
index 224f8d6..8835e4e 100644
--- a/dlls/ddraw/texture.c
+++ b/dlls/ddraw/texture.c
@@ -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;
             }




More information about the wine-cvs mailing list