static ULONG WINAPI Binding_Release(IBinding* iface) { Binding *This = (Binding*)iface; ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n",This, ref); if(!ref) { heap_free(This->URLName); if (This->hCacheFile) CloseHandle(This->hCacheFile); if (This->pstrCache) { UMCloseCacheFileStream(This->pstrCache); IStream_Release((IStream *)This->pstrCache); } if (This->pbscb) IBindStatusCallback_Release(This->pbscb); heap_free(This); URLMON_UnlockModule(); } return ref; }
static void Binding_CloseCacheDownload(Binding *This) { CloseHandle(This->hCacheFile); This->hCacheFile = 0; UMCloseCacheFileStream(This->pstrCache); IStream_Release((IStream *)This->pstrCache); This->pstrCache = 0; }
/************************************************************************** * IStream_fnRelease */ static ULONG WINAPI IStream_fnRelease(IStream *iface) { IUMCacheStream *This = (IUMCacheStream *)iface; ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p)->(count=%u)\n", This, refCount + 1); if (!refCount) { TRACE(" destroying UMCacheStream (%p)\n",This); UMCloseCacheFileStream(This); CloseHandle(This->handle); heap_free(This->pszFileName); heap_free(This->pszURL); heap_free(This); } return refCount; }