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:
parent
1fc5c6b75d
commit
3c98e11b60
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue