strmbase: Reimplement BaseFilterImpl_Release() using a destructor callback.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-05-23 17:06:33 -05:00 committed by Alexandre Julliard
parent 1fc5c6b75d
commit 3c98e11b60
2 changed files with 3 additions and 2 deletions

View File

@ -54,7 +54,7 @@ ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter * iface)
return refCount;
}
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter * iface)
ULONG WINAPI BaseFilterImpl_Release(IBaseFilter *iface)
{
BaseFilter *This = impl_from_IBaseFilter(iface);
ULONG refCount = InterlockedDecrement(&This->refCount);
@ -62,7 +62,7 @@ ULONG WINAPI BaseFilterImpl_Release(IBaseFilter * iface)
TRACE("(%p)->() Release from %d\n", This, refCount + 1);
if (!refCount)
strmbase_filter_cleanup(This);
This->pFuncsTable->filter_destroy(This);
return refCount;
}

View File

@ -171,6 +171,7 @@ typedef struct BaseFilter
typedef struct BaseFilterFuncTable
{
IPin *(*filter_get_pin)(BaseFilter *iface, unsigned int index);
void (*filter_destroy)(BaseFilter *iface);
} BaseFilterFuncTable;
HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);