1

I use DirectShowNet and when my Graph is stopped I release com objects.

The problem is that while I try to release COM objects [ filters, interface] ,sometimes this cleanup cause directshow graph not STOPPED.It "suspend".

If I do not make clen up [ release com objects] everthing is OK [ except i have memory leaks] ...

Here is how i make clean up:

if (videoWindow != nullptr) 
{
    Marshal::ReleaseComObject(videoWindow);
    videoWindow = nullptr;

}

if (mediaControl != nullptr) 
{
    Marshal::ReleaseComObject(mediaControl);
    mediaControl = nullptr;             
}


if (graphBuilder != nullptr)
{
   Marshal::ReleaseComObject(graphBuilder);
   graphBuilder = nullptr;

}

....

What may be wrong? Do I relase filters in a wrong way? What may cause this "unstopable graph"?

Novalis
  • 2,265
  • 6
  • 39
  • 63

1 Answers1

2

You did not mention which exactly call stopped (froze) and what was the call stack.

It is a typical scenario that a faulty filter, or it might be a Sample Grabber filter with a faulty callback, fails to synchronize "main" thread on which it receives stop request, and a worker thread or worker activity on background thread, and eventually locks dead. You should be able to identify a broken component by checking thread states under debugger.

Another method to isolate the problem to specific filter is to temporarily remove certain fragment from the pipeline and find out addition/removal of which fragment leads to the problems.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • It seems that older decoder filter[ffdshow] cause this.[ it does not destruct itself]. I update the decoder filter and now it close up. – Novalis Mar 21 '12 at 14:59