[Live-devel] about ServerMediaSession.cpp

Ross Finlayson finlayson at live555.com
Thu Oct 27 19:33:47 PDT 2005


>But when it comes to "env->reclaim()", because 
>"liveMediaPriv!=NULL", "env" can not be deleted.

That's because there is still an object remaining (see below).

>GXCRTSPServer::~GXCRTSPServer()
>{
>         rtspServer->removeServerMediaSession( sms );

add
         Medium:close(sms);
here.

Alternatively, you can omit the call to
         rtspServer->removeServerMediaSession(sms);
and
         Medium::close(sms);
because closing the RTSP server will automatically reclaim any 
"ServerMediaSession" (and "ServerMediaSubsession") objects that it contains.

I.e., you can just write:

GXCRTSPServer::~GXCRTSPServer()
{
         Medium::close( rtspServer );
         env->reclaim();
         delete scheduler;
}


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



More information about the live-devel mailing list