Re: Memory leak in small video player application
- From: "The March Hare [MVP]" <phil@xxxxxxxxx>
- Date: Mon, 16 Jan 2006 12:33:36 -0700
On Mon, 16 Jan 2006 19:28:10 +0100, Gaël Rosset wrote:
> I have made a small video player which in turns plays small video clips.
> The class soundvideoplayer contains among other things the following
> members :
> IMediaEventEx *g_pEvent;
> IGraphBuilder *pGraph;
> IMediaControl *pControl;
> IMediaEvent *pEvent;
> IMediaSeeking *g_pSeek;
> IBaseFilter *pFilter;
> IBasicAudio *m_pBA;
>
> To play the clips I call the function play below over and over again.
> The problem is that even if I don't run the graph I am leaking memory by
> calling play in loops.
>
> I am calling Release on all used interfaces... I feel blind about the
> issue.
The first thing to do is convert these and all other plain pointers to use
CComPtr and CComQIPtr. It is madness to use plain pointers. You can
release all of the pointers properly with smart pointers by using them in a
class and destroying that class or by using them in a method and exiting
that method.
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
.
- Follow-Ups:
- Re: Memory leak in small video player application
- From: Gaël Rosset
- Re: Memory leak in small video player application
- References:
- Memory leak in small video player application
- From: Gaël Rosset
- Memory leak in small video player application
- Prev by Date: Memory leak in small video player application
- Next by Date: Re: Memory leak in small video player application
- Previous by thread: Memory leak in small video player application
- Next by thread: Re: Memory leak in small video player application
- Index(es):
Relevant Pages
|