From 7c518c3bd149c480ccf6e8935178e48d6ec042e7 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 13 Sep 2021 10:01:25 +0300 Subject: [PATCH] ole32/filemoniker: Remove helper used once. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- 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; + FileMonikerImpl *moniker = impl_from_IMoniker(iface); + ULONG ref = InterlockedDecrement(&moniker->ref); - TRACE("(%p)\n",iface); + TRACE("(%p, refcount %d)\n", iface, ref); - ref = InterlockedDecrement(&This->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 */