Commit 4ea1f357 authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

strmbase: Separate BasePin destructors from Release.

parent 33e0e686
......@@ -401,11 +401,7 @@ ULONG WINAPI BaseOutputPinImpl_Release(IPin * iface)
if (!refCount)
{
FreeMediaType(&This->pin.mtCurrent);
if (This->pAllocator)
IMemAllocator_Release(This->pAllocator);
This->pAllocator = NULL;
CoTaskMemFree(This);
BaseOutputPin_Destroy(This);
return 0;
}
return refCount;
......@@ -849,6 +845,16 @@ HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outp
return E_FAIL;
}
HRESULT WINAPI BaseOutputPin_Destroy(BaseOutputPin *This)
{
FreeMediaType(&This->pin.mtCurrent);
if (This->pAllocator)
IMemAllocator_Release(This->pAllocator);
This->pAllocator = NULL;
CoTaskMemFree(This);
return S_OK;
}
/*** Input Pin implementation ***/
static inline BaseInputPin *impl_BaseInputPin_from_IPin( IPin *iface )
......@@ -900,12 +906,7 @@ ULONG WINAPI BaseInputPinImpl_Release(IPin * iface)
if (!refCount)
{
FreeMediaType(&This->pin.mtCurrent);
if (This->pAllocator)
IMemAllocator_Release(This->pAllocator);
This->pAllocator = NULL;
This->pin.IPin_iface.lpVtbl = NULL;
CoTaskMemFree(This);
BaseInputPin_Destroy(This);
return 0;
}
else
......@@ -1273,3 +1274,14 @@ HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size
CoTaskMemFree(pPinImpl);
return E_FAIL;
}
HRESULT WINAPI BaseInputPin_Destroy(BaseInputPin *This)
{
FreeMediaType(&This->pin.mtCurrent);
if (This->pAllocator)
IMemAllocator_Release(This->pAllocator);
This->pAllocator = NULL;
This->pin.IPin_iface.lpVtbl = NULL;
CoTaskMemFree(This);
return S_OK;
}
......@@ -136,6 +136,7 @@ HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputP
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
HRESULT WINAPI BaseOutputPin_Destroy(BaseOutputPin *This);
/* Base Input Pin */
HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
......@@ -151,6 +152,7 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart,
HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO * pPinInfo,
const BaseInputPinFuncTable* pBaseInputFuncsTable,
LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin);
HRESULT WINAPI BaseInputPin_Destroy(BaseInputPin *This);
typedef struct BaseFilter
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment