|
|
|
date: Thu, 21 Apr 2005 09:30:47 +0200,
group: microsoft.public.win32.programmer.directx.sdk
back
Re: Objects left active...
> "Tobia Quantrill" wrote in message
> news:eUZrfQkRFHA.164@TK2MSFTNGP12.phx.gbl...
> > I managed to write a dummy filter with just one input pin. For now there
> is
> > no functionality. But, there is one problem. I'm using graphedt.exe as
> > executable for debug session. I can add my dummy filter to the graph,
but
> > when I shut down graphedt.exe, I'm getting an ASSERT Failed.
> >
> > Executable: graphedt.exe Pid d48 Tid d60. Module dummyFilter.ax, 2
objects
> > left active!
> > At line 317 of C:\DXSDK\Samples\C++\DirectShow\BaseClasses\dllentry.cpp
> > Continue? (Cancel to debug)
> >
> > I can see that static method ObjectsActive() returned 2 instead of 0.
> Should
> > I override some method through which is filtergraph trying to tell me to
> > shutdown or maybe something else???
> >
> > My filter class is derived from CBaseFilter, and the only pin I have is
> > derived from CBaseInputPin (member variable of my class derived from
> > CBaseFilter).
> >
> > Any suggestions or comments are welcome...
> >
>
> I've found one problem. The bug was in GetPin() method. I was calling
> AddRef() on my pin whenever someone called GetPin(). The only problem left
> is destruction of my pin. Like I said, my pin class is derived from
> CBaseInputPin, it is member variable of my filer (derived from
CBaseFilter.
> I guess, the question could be:
> What to do during creation/destruction of pin?
>
> TIA
>
Okay, the problem is solved... Although all these classes are inherited from
IUnknown, objects must be destroyed with delete, instead of calling
Release() method... Don't see why MS couldn't be consistent regarding this??
Same goes for not calling AddRef() in GetPin() method...
date: Fri, 22 Apr 2005 10:28:55 +0200
author: Tobia Quantrill
|
|