strmbase: Separate BaseFilter destructor from Release.

This commit is contained in:
Thomas Faber 2014-07-18 22:19:40 +02:00 committed by Alexandre Julliard
parent 509bdae8e2
commit 992f5345ed
2 changed files with 14 additions and 8 deletions

View File

@ -69,14 +69,7 @@ ULONG WINAPI BaseFilterImpl_Release(IBaseFilter * iface)
TRACE("(%p)->() Release from %d\n", This, refCount + 1); TRACE("(%p)->() Release from %d\n", This, refCount + 1);
if (!refCount) if (!refCount)
{ BaseFilter_Destroy(This);
if (This->pClock)
IReferenceClock_Release(This->pClock);
This->IBaseFilter_iface.lpVtbl = NULL;
This->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csFilter);
}
return refCount; return refCount;
} }
@ -218,3 +211,15 @@ HRESULT WINAPI BaseFilter_Init(BaseFilter * This, const IBaseFilterVtbl *Vtbl, c
return S_OK; return S_OK;
} }
HRESULT WINAPI BaseFilter_Destroy(BaseFilter * This)
{
if (This->pClock)
IReferenceClock_Release(This->pClock);
This->IBaseFilter_iface.lpVtbl = NULL;
This->csFilter.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csFilter);
return S_OK;
}

View File

@ -194,6 +194,7 @@ LONG WINAPI BaseFilterImpl_GetPinVersion(BaseFilter* This);
VOID WINAPI BaseFilterImpl_IncrementPinVersion(BaseFilter* This); VOID WINAPI BaseFilterImpl_IncrementPinVersion(BaseFilter* This);
HRESULT WINAPI BaseFilter_Init(BaseFilter * This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable* pBaseFuncsTable); HRESULT WINAPI BaseFilter_Init(BaseFilter * This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable* pBaseFuncsTable);
HRESULT WINAPI BaseFilter_Destroy(BaseFilter * This);
/* Enums */ /* Enums */
HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum); HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum);