[Live-devel] Proper cleanup of live555 instances

Silvain Beriault silvain.beriault at larus.com
Fri Jul 4 08:33:32 PDT 2008


Ross Finlayson wrote:
>> here is currently how I currently cleanup:
>>
>> sink->stopPlaying();
>> Medium::close(framedSource);
>> Medium::close(sink); <== crashes
>> env->reclaim();
>>
>> Here are my questions:
>>
>> 1. Overall what should be the full cleanup sequence for that example?
>
> I'm not sure why you got a crash, but try closing the sink *before* 
> closing the source.
>
>
>> 2. Do I need to "delete scheduler" or env->reclaim() does that
>
> Yes, you should also call
>     delete scheduler;
> just before calling
>     env->reclaim();
>
>
>> 3. Why Medium::close(sink) crashes?
>
> I don't know.
>
>>  (is it already being cleaned up by Medium::close(framedSource) ?)
>
> No.
>
>
>> 4. How to cleanup RTCPInstance ?
>
> Call
>     Medum::close(rtcp);
> just before closing the sink.
>
> Note that, in general, you should destroy objects in the reverse order 
> from that in which you create them.  So try:
>     sink->stopPlaying();
>     Medum::close(rtcp);
>     Medium::close(sink);
>     Medium::close(framedSource);
>     delete scheduler;
>     env->reclaim();
Thank you, This cleanup sequence is working fine.



More information about the live-devel mailing list