[Live-devel] small leaks?
Ross Finlayson
finlayson at live.com
Tue Jun 8 16:32:13 PDT 2004
>*media.cpp, _Tables* getOurTables(UsageEnvironment& env)
>l 49:
> env.liveMediaPriv = new _Tables;
>
>But nowhere I see deletion of liveMediaPriv.
Yes, this is a 'leak', albeit an unimportant one, because programs that use
these libraries will typically create very few "UsageEnvironment" objects
(in fact, usually just one), and the lifetime of these objects will
typically be the same as that of the entire program.
Unfortunately, there's no good way to fix this without making the
"UsageEnvironment" class aware of the "liveMedia" library - something that
I don't want to do, because I want to allow for programs that use the
"UsageEnvironment" library without the "liveMedia" library. But as I noted
above, this is not an important 'leak'.
>*amraudiortpsource.cpp, RawAMRRTPSource constructor
>a new AMRBufferedPacketFactory(*this) is passed as argument to the
>MultiFramedRTPSource constructor. I think that this
>AMRBufferedPacketFactory will not be deleted.
Actually, it is deleted by
delete fPacketFactory;
in
ReorderingPacketBuffer::~ReorderingPacketBuffer()
which in turn is called by
delete fReorderingBuffer;
in
MultiFramedRTPSource::~MultiFramedRTPSource()
So, this is not a leak.
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list