static ULONG WINAPI IDirect3DQuery9Impl_Release(LPDIRECT3DQUERY9 iface) { IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) : ReleaseRef to %d\n", This, ref); if (ref == 0) { EnterCriticalSection(&d3d9_cs); IWineD3DQuery_Release(This->wineD3DQuery); LeaveCriticalSection(&d3d9_cs); IUnknown_Release(This->parentDevice); HeapFree(GetProcessHeap(), 0, This); } return ref; }
static ULONG WINAPI IDirect3DQuery9Impl_Release(LPDIRECT3DQUERY9 iface) { IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; ULONG ref = InterlockedDecrement(&This->ref); TRACE("%p decreasing refcount to %u.\n", iface, ref); if (ref == 0) { wined3d_mutex_lock(); IWineD3DQuery_Release(This->wineD3DQuery); wined3d_mutex_unlock(); IDirect3DDevice9Ex_Release(This->parentDevice); HeapFree(GetProcessHeap(), 0, This); } return ref; }