<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
--></style><title>Re: [Live-devel] Memory leak on closing client and
session</title></head><body>
<blockquote type="cite" cite><font face="Arial" size="-1">I created
simple video stream (mpeg4) and I'm using FileSink as default
sink.</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">Everything
is fine until I try to end all sessions and streaming. Everything
ends</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">and every
subsession and session is closed but there still apears to be memory
leak</font></blockquote>
<blockquote type="cite" cite><font face="Arial"
size="-1">somwhere.</font></blockquote>
<blockquote type="cite" cite> </blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">I'm opening
the stream like this:</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">1. Get
discription</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">2. Create
new media session</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">3. Init
media sub sessions</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">4.
setupMediaSubsession(subsession)</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">5. create
file sink</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">6. Setting
subsession->sink = filesink;</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">7.
subsession->sink->startPlauying(subsession->readSource,NULL,<span
></span>subsession);</font></blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">8.
rtspClient->playMediaSession(...);</font></blockquote>
<blockquote type="cite" cite> </blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">I'm ending
streams like this:</font></blockquote>
<blockquote type="cite" cite><font face="Arial"
size="-1"> rtspClient_->teardownMediaSession(*mediaSession_);<br
>
<br>
MediaSubsessionIterator iter(*mediaSession_);<br>
MediaSubsession *subsession = iter.next();<br>
<br>
<br>
while (subsession != NULL)<br>
{<br>
subsession->sink->stopPlaying();<br>
Medium::close(subsession->sink);<br>
subsession->sink =
NULL;<br>
subsession =
iter.next();<br>
}<br>
<br>
MediaSession::close(mediaSession_);<br>
mediaSession_ = NULL;</font></blockquote>
<blockquote type="cite" cite> </blockquote>
<blockquote type="cite" cite> </blockquote>
<blockquote type="cite" cite><font face="Arial" size="-1">Did I miss
something?</font></blockquote>
<div><br></div>
<div>You should also be closing (deleting) the "RTSPClient"
object. Plus, of course, the "UsageEnvironment" and
"TaskScheduler" objects, if you're not planning on using
them again. (In that case, though, you might as well just exit()
the process.)</div>
<x-sigsep><pre>--
</pre></x-sigsep>
<div><br>
Ross Finlayson<br>
Live Networks, Inc.<br>
http://www.live555.com/</div>
</body>
</html>