[Live-devel] memory leak with cleaning up
AMRAudioRTPSource?
Ross Finlayson
finlayson at live.com
Wed Aug 25 15:43:28 PDT 2004
>I have fixed this problem by adding the following line after
>"Medium::close(fReadSource)":
>
> if (fRTPSource != fReadSource) Medium::close(fRTPSource);
>
>Is this a bug that needs fixing and is this the correct fix?
There is a bug here, but that's not the correct fix, because it's usually
the case that the 'read source' - if it's different from the 'RTP source' -
will be a subclass of "FramedFilter", and so closing the 'read source' will
automatically close its input source (see "FramedFilter::~FramedFilter()").
The problem in this case, though, is that "AMRDeinterleaver" is *not* a
subclass of "FramedFilter", and so its input source does not get closed
automatically by the destructor. So the memory leak you found was real.
The fix is to add the following to "AMRDeinterleaver::~AMRDeinterleaver()"
Medium::close(fInputSource);
I will include this fix in the next release. Thanks for reporting this bug.
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list