dmusic: Display new ref in trace for AddRef and Release for IDirectMusicInstrument.

This commit is contained in:
Christian Costa 2012-05-11 08:19:18 +02:00 committed by Alexandre Julliard
parent 1501d3a49a
commit 5ae4238cea
1 changed files with 13 additions and 14 deletions

View File

@ -57,30 +57,29 @@ static HRESULT WINAPI IDirectMusicInstrumentImpl_QueryInterface(LPDIRECTMUSICINS
static ULONG WINAPI IDirectMusicInstrumentImpl_AddRef(LPDIRECTMUSICINSTRUMENT iface) static ULONG WINAPI IDirectMusicInstrumentImpl_AddRef(LPDIRECTMUSICINSTRUMENT iface)
{ {
IDirectMusicInstrumentImpl *This = impl_from_IDirectMusicInstrument(iface); IDirectMusicInstrumentImpl *This = impl_from_IDirectMusicInstrument(iface);
ULONG refCount = InterlockedIncrement(&This->ref); 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) static ULONG WINAPI IDirectMusicInstrumentImpl_Release(LPDIRECTMUSICINSTRUMENT iface)
{ {
IDirectMusicInstrumentImpl *This = impl_from_IDirectMusicInstrument(iface); IDirectMusicInstrumentImpl *This = impl_from_IDirectMusicInstrument(iface);
ULONG refCount = InterlockedDecrement(&This->ref); ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n", This, refCount + 1); TRACE("(%p)->(): new ref = %u\n", iface, ref);
if (!refCount) { if (!ref)
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
}
DMUSIC_UnlockModule(); DMUSIC_UnlockModule();
return refCount; return ref;
} }
/* IDirectMusicInstrumentImpl IDirectMusicInstrument part: */ /* IDirectMusicInstrumentImpl IDirectMusicInstrument part: */