[Live-devel] about ServerMediaSession.cpp

Zhixue Zhang zhangzx at rcs-9000.com
Fri Oct 28 09:31:33 PDT 2005


Ross Finlayson,

Thanks for you reply.

But when it comes to "env->reclaim()", because "liveMediaPriv!=NULL", "env" can not be deleted. My constructor and destructor is as following:

GXCRTSPServer::GXCRTSPServer()
{
	scheduler = BasicTaskScheduler::createNew();
	env = BasicUsageEnvironment::createNew( *scheduler );
	
//	UserAuthenticationDatabase* authDB = NULL;

	rtspServer = RTSPServer::createNew( *env, 0, 0 );
	//rtsp://198.87.116.52:8554/mpeg4
	
	char const *streamName = "mpeg4";
	char const *inputFileName = "test.m4v";
	sms = ServerMediaSession::createNew(*env, streamName, streamName, "");
	sub = MPEG4VideoFileServerMediaSubsession
		::createNew( *env, inputFile, false );
	sms->addSubsession( sub );
 	rtspServer->addServerMediaSession( sms );
} 

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

"Rational Purify" has been empoyed to detect memory leak. About 1468 bytes has been leaked.

Why?  ):

Thanks again. 
¡¡¡¡¡¡¡¡¡¡Zhixue Zhang
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡zhangzx at rcs-9000.com
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2005-10-28







More information about the live-devel mailing list