Michael Stefaniuc : dmloader: Don' t crash on container destruction if it was never loaded.

Alexandre Julliard julliard at winehq.org
Thu Mar 13 14:40:34 CDT 2014


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Wed Mar 12 23:10:12 2014 +0100

dmloader: Don't crash on container destruction if it was never loaded.

---

 dlls/dmloader/container.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c
index f53a074..4fb5f97 100644
--- a/dlls/dmloader/container.c
+++ b/dlls/dmloader/container.c
@@ -68,7 +68,6 @@ static HRESULT destroy_dmcontainer(IDirectMusicContainerImpl *This)
 	IStream_Release (This->pStream);
 
 	/* FIXME: release allocated entries */
-	unlock_module();
 
 	return S_OK;
 }
@@ -108,8 +107,10 @@ static ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_Release (LPD
 	DWORD dwRef = InterlockedDecrement (&This->dwRef);
 	TRACE("(%p): ReleaseRef to %d\n", This, dwRef);
 	if (dwRef == 0) {
-                destroy_dmcontainer(This);
+                if (This->pStream)
+                        destroy_dmcontainer(This);
 		HeapFree(GetProcessHeap(), 0, This);
+                unlock_module();
 	}
 	
 	return dwRef;




More information about the wine-cvs mailing list