mirror of
https://github.com/reactos/wine.git
synced 2025-01-24 04:45:18 +00:00
- Use only stored result of Interlocked* in AddRef/Release.
- Expand TRACEs to display the ref count.
This commit is contained in:
parent
11db0ea655
commit
79ecb0d783
@ -78,25 +78,25 @@ static HRESULT WINAPI SecManagerImpl_QueryInterface(IInternetSecurityManager* if
|
||||
static ULONG WINAPI SecManagerImpl_AddRef(IInternetSecurityManager* iface)
|
||||
{
|
||||
SecManagerImpl *This = (SecManagerImpl *)iface;
|
||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p)\n",This);
|
||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||
|
||||
return InterlockedIncrement(&This->ref);
|
||||
return refCount;
|
||||
}
|
||||
|
||||
static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface)
|
||||
{
|
||||
SecManagerImpl *This = (SecManagerImpl *)iface;
|
||||
ULONG ref;
|
||||
TRACE("(%p)\n",This);
|
||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||
|
||||
ref = InterlockedDecrement(&This->ref);
|
||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
|
||||
|
||||
/* destroy the object if there's no more reference on it */
|
||||
if (ref==0){
|
||||
if (!refCount){
|
||||
HeapFree(GetProcessHeap(),0,This);
|
||||
}
|
||||
return ref;
|
||||
return refCount;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI SecManagerImpl_SetSecuritySite(IInternetSecurityManager *iface,
|
||||
@ -238,10 +238,11 @@ static HRESULT WINAPI ZoneMgrImpl_QueryInterface(IInternetZoneManager* iface, RE
|
||||
static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
|
||||
{
|
||||
ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
|
||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p) was %lu\n", This, This->ref);
|
||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||
|
||||
return InterlockedIncrement(&This->ref);
|
||||
return refCount;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
@ -250,15 +251,13 @@ static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
|
||||
static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface)
|
||||
{
|
||||
ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
|
||||
ULONG ref;
|
||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p) was %lu\n", This, This->ref);
|
||||
ref = InterlockedDecrement(&This->ref);
|
||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
|
||||
|
||||
if(!ref)
|
||||
if(!refCount)
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
|
||||
return ref;
|
||||
return refCount;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
|
@ -103,10 +103,11 @@ static HRESULT WINAPI URLMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,
|
||||
static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
|
||||
{
|
||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p)\n",This);
|
||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||
|
||||
return InterlockedIncrement(&This->ref);
|
||||
return refCount;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
@ -115,19 +116,17 @@ static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
|
||||
static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface)
|
||||
{
|
||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
||||
ULONG ref;
|
||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p)\n",This);
|
||||
|
||||
ref = InterlockedDecrement(&This->ref);
|
||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
|
||||
|
||||
/* destroy the object if there's no more reference on it */
|
||||
if (ref == 0) {
|
||||
if (!refCount) {
|
||||
HeapFree(GetProcessHeap(),0,This->URLName);
|
||||
HeapFree(GetProcessHeap(),0,This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
return refCount;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user