[Live-devel] Enumerate all 'clients' and memory leak

Ross Finlayson finlayson at live555.com
Thu Sep 20 06:37:23 PDT 2012


>> My ptable pointer allocated in MediaLookupTable::ourMedia but never deleted
>> No, that's incorrect - it *will* get deleted, if/when all "Medium" objects end
> up getting deleted (so there's no memory leak here).
> 
> Both VLD (visual leak detector) and ms crt debug runtime reports leaks in that
> code.

Once again, this table will get deleted if (and only if) all "Medium" objects get deleted.  (Recall that "Medium" objects are deleted by calling "Medium::close()".)


> BTW, i also interested in removing UsageEnvironment object too. In the sample
> code you are advised termination code looks like this:
> 
> pliveenvironment->reclaim();
> delete m_plivetaskscheduller;

That's correct.  Note that the call to "UsageEnvironment::reclaim()" will reclaim all allocated memory, but *only if* all "Medium" objects have already been deleted.

But the best/easiest way to reclaim all of the memory for all of the LIVE555-allocated objects is simply to call "exit(0)" - i.e., by exiting the entire process.  (But I forget - this is the 21st century.  For some odd reason, software developers now have forgotten how to structure their applications using multiple processes :-)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120920/593cc357/attachment.html>


More information about the live-devel mailing list