static ULONG WINAPI IDirectSound3DBufferImpl_Release(IDirectSound3DBuffer *iface) { IDirectSoundBufferImpl *This = impl_from_IDirectSound3DBuffer(iface); ULONG ref = InterlockedDecrement(&This->ref3D); TRACE("(%p) ref was %d\n", This, ref + 1); if (!ref && !InterlockedDecrement(&This->numIfaces)) secondarybuffer_destroy(This); return ref; }
static ULONG WINAPI IDirectSound3DBufferImpl_Release(LPDIRECTSOUND3DBUFFER iface) { IDirectSound3DBufferImpl *This = (IDirectSound3DBufferImpl *)iface; ULONG ref = InterlockedDecrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref + 1); if (!ref) { This->dsb->ds3db = NULL; if (!InterlockedDecrement(&This->dsb->numIfaces)) secondarybuffer_destroy(This->dsb); HeapFree(GetProcessHeap(), 0, This); TRACE("(%p) released\n", This); } return ref; }