From abc6d186ead35d2cad28c5a2a69183c6ed4f3a5f Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Mon, 12 Mar 2012 19:55:04 +0100 Subject: [PATCH] amstream: Free all used resources when releasing MultiMediaStream object. --- dlls/amstream/amstream.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/amstream/amstream.c b/dlls/amstream/amstream.c index a731d5e633b..c771f774ac3 100644 --- a/dlls/amstream/amstream.c +++ b/dlls/amstream/amstream.c @@ -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; }