Re: DirectShow heap memory leak

From: Michael Schwab (michael.schwab_at_cobecv.com)
Date: 01/08/05


Date: Fri, 7 Jan 2005 17:41:05 -0700

Yes, that's what I'm saying.
And I know something is seriously wrong!
How do I fix it?

"Thore Karlsen [MVP DX]" <sid@6581.com> wrote in message
news:5j2ut0lm4vfg7bd62hci7fho33kqso19qj@4ax.com...
> On Fri, 7 Jan 2005 14:56:44 -0700, "Michael Schwab"
> <michael.schwab@cobecv.com> wrote:
>
> >Working backwards is a great idea - here goes:
> >
> >- Already had the pVidWin stuff commented out.
> >- Commented out the Run() and the infinite wait - still have the memory
> >leak.
> >- Commented out the Stop() and the RenderFile() - still have the memory
> >leak.
> >- Commented out the QueryInterface() for pControl and pEvent, and also
their
> >Release calls - still have the memory leak.
> >- Commented out the CoCreateInstance() and pGraph->Release() calls - no
more
> >memory leak! (Not surprising because the CoInitialize wasn't using any
heap
> >space anyway, and that's all that was left).
> >- Uncommented the CoCreateInstance() call but left the pGraph->Release()
> >call commented out - now the memory doubles to 2.097 Mb, which is the
amount
> >that the CoCreateInstance() call usually takes.
> >
> >So for some reason the pGraph->Release() is only freeing up exactly half
the
> >space that CoCreateInstance() has allocated. And calling
pGraph->Release()
> >doesn't help, and sometimes crashes it (especially under WinXP).
> >
> >So what's wrong with my CoCreateInstance() call? Is it that pGraph is a
> >local (stack?) variable?
>
> Let me see if I understand correctly. This example would produce a
> memory leak:
>
> CoInitialize();
> CoCreateInstance(... &pGraph);
> pGraph->Release();
> CoUninitialize();
>
> Is that what you are saying? This leaks when absolutely no other code is
> executed? If that's the case, there's something seriously wrong with
> your system. :)
>
> --
> New to newsgroups? Read: http://dev.6581.com/newsgroups.html



Relevant Pages

  • Re: DirectShow heap memory leak
    ... Yes, that's what I'm saying. ... >>that the CoCreateInstance() call usually takes. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: DirectShow heap memory leak
    ... >- Commented out the QueryInterfacefor pControl and pEvent, ... >Release calls - still have the memory leak. ... >So what's wrong with my CoCreateInstance() call? ... CoInitialize(); ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: DirectShow heap memory leak
    ... >- Commented out the QueryInterfacefor pControl and pEvent, ... >Release calls - still have the memory leak. ... >So what's wrong with my CoCreateInstance() call? ... CoInitialize(); ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Dynamically sizing Display Fonts
    ... I'm not sure if you are saying that you have a memory leak above. ... // restore original font before deleting ... Prev by Date: ...
    (microsoft.public.win32.programmer.gdi)
  • Re: How to allocate new class instance on the heap?
    ... Are you saying that ... will allocate ClassInstanceVariable on the heap? ... automatically deallocated when the function declaring ... ClassInstanceVariable exits? ...
    (comp.lang.pascal.delphi.misc)