[Live-devel] Proper cleanup of live555 instances
Ross Finlayson
finlayson at live555.com
Thu Jul 3 16:16:20 PDT 2008
>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();
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list