Nikolay Sivov : ole32/filemoniker: Remove helper used once.
Alexandre Julliard
julliard at winehq.org
Mon Sep 13 16:12:34 CDT 2021
Module: wine
Branch: master
Commit: 7c518c3bd149c480ccf6e8935178e48d6ec042e7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7c518c3bd149c480ccf6e8935178e48d6ec042e7
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon Sep 13 10:01:25 2021 +0300
ole32/filemoniker: Remove helper used once.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ole32/filemoniker.c | 37 ++++++++++---------------------------
1 file changed, 10 insertions(+), 27 deletions(-)
diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c
index d7c2a5a5ea7..d3940a9365f 100644
--- a/dlls/ole32/filemoniker.c
+++ b/dlls/ole32/filemoniker.c
@@ -59,7 +59,6 @@ static inline FileMonikerImpl *impl_from_IROTData(IROTData *iface)
/* Local function used by filemoniker implementation */
static HRESULT FileMonikerImpl_Construct(FileMonikerImpl* iface, LPCOLESTR lpszPathName);
-static HRESULT FileMonikerImpl_Destroy(FileMonikerImpl* iface);
/*******************************************************************************
* FileMoniker_QueryInterface
@@ -116,21 +115,19 @@ FileMonikerImpl_AddRef(IMoniker* iface)
return InterlockedIncrement(&This->ref);
}
-/******************************************************************************
- * FileMoniker_Release
- */
-static ULONG WINAPI
-FileMonikerImpl_Release(IMoniker* iface)
+static ULONG WINAPI FileMonikerImpl_Release(IMoniker* iface)
{
- FileMonikerImpl *This = impl_from_IMoniker(iface);
- ULONG ref;
-
- TRACE("(%p)\n",iface);
+ FileMonikerImpl *moniker = impl_from_IMoniker(iface);
+ ULONG ref = InterlockedDecrement(&moniker->ref);
- ref = InterlockedDecrement(&This->ref);
+ TRACE("(%p, refcount %d)\n", iface, ref);
- /* destroy the object if there are no more references to it */
- if (ref == 0) FileMonikerImpl_Destroy(This);
+ if (!ref)
+ {
+ if (moniker->pMarshal) IUnknown_Release(moniker->pMarshal);
+ HeapFree(GetProcessHeap(), 0, moniker->filePathName);
+ HeapFree(GetProcessHeap(), 0, moniker);
+ }
return ref;
}
@@ -452,20 +449,6 @@ FileMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
return S_OK;
}
-/******************************************************************************
- * FileMoniker_Destroy (local function)
- *******************************************************************************/
-HRESULT FileMonikerImpl_Destroy(FileMonikerImpl* This)
-{
- TRACE("(%p)\n",This);
-
- if (This->pMarshal) IUnknown_Release(This->pMarshal);
- HeapFree(GetProcessHeap(),0,This->filePathName);
- HeapFree(GetProcessHeap(),0,This);
-
- return S_OK;
-}
-
/******************************************************************************
* FileMoniker_BindToObject
*/
More information about the wine-cvs
mailing list