[Live-devel] about ServerMediaSession.cpp

Ross Finlayson finlayson at live555.com
Thu Oct 27 08:10:26 PDT 2005


>In my class constructor:BasicTaskScheduler 
>*scheduler,BasicUsageEnvironment *env, RTSPServer *rtspserver, 
>ServerMediaSession *servermediasession, and 
>MPEG4VideoFileServerMediaSubsession * sub are all "createNew"ed.
>And in my destructor:
>         Medium::close(sub);
>         rtspServer->removeServerMediaSession( sms );
>         Medium::close( rtspServer );
>         env->reclaim();
>         delete scheduler;
>
>Is it ok?

No, you should not call "Medium::close(sub)" because - as you noted - 
"ServerMediaSubsession" objects are deleted automatically when their 
parent "ServerMediaSession" object is deleted.

The rest of your code is OK.


	Ross Finlayson
	Live Networks, Inc. (LIVE555.COM)
	<http://www.live555.com/>



More information about the live-devel mailing list