[patch] bugfix: memory leak in TStreamBufferPlayer9 (1 Viewer)

cpp2005

Retired Team Member
  • Premium Supporter
  • November 7, 2006
    164
    127
    While working on something else, I discovered that tsfilesource destructor is always crashing when releasing its filter's graph. The exception is caught inside Marshal.ReleaseComObject call, so nobody can see this crash.
    All this happens in Cleanup() method of TStreamBufferPlayer9, which looks like this:

    Code:
            ...
            if (_vmr9 != null)
            {
              Log.Info("TSStreamBufferPlayer9: vmr9 dispose");
              _vmr9.Dispose();
              _vmr9 = null;
            }
            ...
            DirectShowUtil.RemoveFilters(_graphBuilder); //here tsfilesource is released
            ....

    I found that if _vmr9 is released after tsfilesource, the crash is gone! Don't know what exactly _vmr9 is doing that causes the crash.
    Here is the patch on sourceforge.
     

    Broceliande

    Retired Team Member
  • Premium Supporter
  • April 26, 2006
    186
    2
    Hi , you spotted an issue we were looking into since a while now.
    This one was causing crashes after 21 files were played ...
    Thx for your patch , it's in svn now and will be tested .
     

    Users who are viewing this thread

    Top Bottom