[Live-devel] memory leak
Ross Finlayson
finlayson at live555.com
Tue Nov 2 06:06:53 PDT 2010
>m_pUsageEnvironment = BasicUsageEnvironment::createNew(*m_pTaskScheduler);
>if(m_pUsageEnvironment == NULL)
>{
>service_error.init(service_error_type_failed,"BasicUsageEnvironment::createNew failed");
>return service_error;
>}
>
>and . how to delete this m_pUsageEnvironment;
Objects of class "UsageEnvironment" (or subclasses) are deleted using
"UsageEnvironment::reclaim()", rather than "delete".
So, just call:
m_pUsageEnvironment->reclaim();
and then
delete m_pTaskScheduler;
Of course, you should do this only after you have deleted any "Media"
subclassed objects - using "Medium::close()".
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list