[PATCH 2/4] dmusic: Display new ref in trace for AddRef and Release for IDirectMusicInstrument.

Christian Costa titan.costa at gmail.com
Fri May 11 01:19:18 CDT 2012


---
 dlls/dmusic/instrument.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c
index 6eaa708..9c3d3d6 100644
--- a/dlls/dmusic/instrument.c
+++ b/dlls/dmusic/instrument.c
@@ -57,30 +57,29 @@ static HRESULT WINAPI IDirectMusicInstrumentImpl_QueryInterface(LPDIRECTMUSICINS
 
 static ULONG WINAPI IDirectMusicInstrumentImpl_AddRef(LPDIRECTMUSICINSTRUMENT iface)
 {
-	IDirectMusicInstrumentImpl *This = impl_from_IDirectMusicInstrument(iface);
-	ULONG refCount = InterlockedIncrement(&This->ref);
+    IDirectMusicInstrumentImpl *This = impl_from_IDirectMusicInstrument(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
 
-	TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
-	DMUSIC_LockModule();
+    DMUSIC_LockModule();
 
-	return refCount;
+    return ref;
 }
 
 static ULONG WINAPI IDirectMusicInstrumentImpl_Release(LPDIRECTMUSICINSTRUMENT iface)
 {
-	IDirectMusicInstrumentImpl *This = impl_from_IDirectMusicInstrument(iface);
-	ULONG refCount = InterlockedDecrement(&This->ref);
+    IDirectMusicInstrumentImpl *This = impl_from_IDirectMusicInstrument(iface);
+    ULONG ref = InterlockedDecrement(&This->ref);
 
-	TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
-	if (!refCount) {
-		HeapFree(GetProcessHeap(), 0, This);
-	}
+    if (!ref)
+        HeapFree(GetProcessHeap(), 0, This);
 
-	DMUSIC_UnlockModule();
-	
-	return refCount;
+    DMUSIC_UnlockModule();
+
+    return ref;
 }
 
 /* IDirectMusicInstrumentImpl IDirectMusicInstrument part: */




More information about the wine-patches mailing list