amstream: Free all used resources when releasing MultiMediaStream object.

This commit is contained in:
Christian Costa 2012-03-12 19:55:04 +01:00 committed by Alexandre Julliard
parent 14e228c699
commit abc6d186ea

View File

@ -106,11 +106,20 @@ static ULONG WINAPI IAMMultiMediaStreamImpl_Release(IAMMultiMediaStream* iface)
{
IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface);
ULONG ref = InterlockedDecrement(&This->ref);
ULONG i;
TRACE("(%p/%p)\n", iface, This);
if (!ref)
{
for(i = 0; i < This->nbStreams; i++)
IMediaStream_Release(This->pStreams[i]);
if (This->ipin)
IPin_Release(This->ipin);
if (This->pFilterGraph)
IGraphBuilder_Release(This->pFilterGraph);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}