<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>H<FONT face="Times New Roman" size=3>i
</FONT>Ross.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> In the past you sayd (let me not
search that mail!) that by now there is not a way to release live clientsessions
when the RTSPServer is being deleted.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> I solved this issue with some
code and I'd like to know your opinion about my solution.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> I
defined fRTSPClientSessions in RTSPServer the same way it has
fServerMediaSessions.</FONT></DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2> So in the RTSPServer constructor
we find:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<DIV>[code]</DIV>
fServerMediaSessions(HashTable::create(STRING_HASH_KEYS)), <BR>#if
(USE_CLIENT_SESSION_MANAGEMENT)<BR>
fRTSPClientSessions(HashTable::create(STRING_HASH_KEYS)),<BR>#endif //
USE_CLIENT_SESSION_MANAGEMENT<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV>[/code]</DIV>
<DIV> </DIV></FONT></DIV>
<DIV><FONT face=Arial size=2>and in the RTSPServer destructor we
find</FONT></DIV>
<DIV> </DIV>
<DIV>[code]</DIV>
<DIV> <BR>
::closeSocket(fServerSocket);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#if (USE_CLIENT_SESSION_MANAGEMENT)<BR> //
rimozione di eventuali client ancora presenti // deletion of live clients, if
any<BR> while (1) {<BR> RTSPClientSession*
rtspClientSession<BR> =
(RTSPClientSession*)fRTSPClientSessions->RemoveNext();<BR>
if (rtspClientSession == NULL) break;<BR> try { delete
rtspClientSession ; }catch(...)<BR> {
<BR> int a = 10 ; // for debug
purpose<BR> }<BR> }<BR>#endif //
USE_CLIENT_SESSION_MANAGEMENT</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> // Remove all server media sessions (they'll
get deleted when they're finished):<BR> while (1) {<BR>
ServerMediaSession* serverMediaSession<BR> =
(ServerMediaSession*)fServerMediaSessions->RemoveNext();<BR>
if (serverMediaSession == NULL) break;<BR>
removeServerMediaSession(serverMediaSession);<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> // Finally, delete the session table
itself:<BR> delete fServerMediaSessions;<BR>#if
(USE_CLIENT_SESSION_MANAGEMENT)<BR> delete fRTSPClientSessions ;<BR>
<DIV>#endif // USE_CLIENT_SESSION_MANAGEMENT</DIV>
<DIV>[/code]</DIV>
<DIV> </DIV></DIV></FONT>
<DIV><FONT face=Arial size=2>In RTSPServer::RTSPClientSession constructor we
find</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<DIV>[code]</DIV></FONT><FONT face=Arial size=2>
fTCPStreamIdCount(0), fNumStreamStates(0), fStreamStates(NULL) {<BR>#if
(USE_CLIENT_SESSION_MANAGEMENT)<BR> char strKey[50] ;<BR> unsigned
__int64 ullAddress = (unsigned __int64)this ;<BR> sprintf( strKey,
"%I64u", ullAddress ) ;<BR> // add without check for previous existing
key<BR> fOurServer.fRTSPClientSessions->Add( strKey, this ) ;<BR>#endif
// USE_CLIENT_SESSION_MANAGEMENT<BR> // Arrange to handle incoming
requests:<BR></FONT><FONT face=Arial size=2><FONT face=Arial
size=2>[/code]</DIV>
<DIV> </DIV>
<DIV>and in RTSPServer::RTSPClientSession destructor we find</DIV>
<DIV> </DIV>
<DIV>
<DIV>[code]</DIV> reclaimStreamStates();</DIV>
<DIV> </DIV>
<DIV>#if (USE_CLIENT_SESSION_MANAGEMENT)<BR> char strKey[50] ;<BR>
unsigned __int64 ullAddress = (unsigned __int64)this ;<BR> sprintf(
strKey, "%I64u", ullAddress ) ;<BR>
fOurServer.fRTSPClientSessions->Remove( strKey ) ;<BR>#endif //
USE_CLIENT_SESSION_MANAGEMENT</DIV>
<DIV>[/code]</DIV>
<DIV> </DIV>
<DIV> Ross, is there any pitfall in this clientsession
management?</DIV>
<DIV> </DIV>
<DIV>Thank you very much,</DIV>
<DIV> </DIV>
<DIV> Renato</DIV>
<DIV> </DIV></FONT></FONT>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=ljsthestar@gmail.com href="mailto:ljsthestar@gmail.com">sri kanth</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=live-devel@ns.live555.com
href="mailto:live-devel@ns.live555.com">live-devel@ns.live555.com</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, January 06, 2009 5:29
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Norton AntiSpam] [Live-devel]
Memory leaks</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><BR></DIV>
<P>Hi Ross, <BR></P>
<P> I am sending the file
which describes regarding the memory leak in the code.</P>
<P></P>
<P>Thanks,</P>
<P>Viswajeet</P>
<P>
<HR>
<P></P>_______________________________________________<BR>live-devel mailing
list<BR><A
href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</A><BR><A
href="http://lists.live555.com/mailman/listinfo/live-devel">http://lists.live555.com/mailman/listinfo/live-devel</A><BR></BLOCKQUOTE></BODY></HTML>