[Live-devel] Memory leak on closing client and sessions

Ross Finlayson finlayson at live555.com
Fri Oct 23 18:31:06 PDT 2009


>I created simple video stream (mpeg4) and I'm using FileSink as default sink.
>Everything is fine until I try to end all sessions and streaming. 
>Everything ends
>and every subsession and session is closed but there still apears to 
>be memory leak
>somwhere.
>
>I'm opening the stream like this:
>1. Get discription
>2. Create new media session
>3. Init media sub sessions
>4. setupMediaSubsession(subsession)
>5. create file sink
>6. Setting subsession->sink = filesink;
>7. subsession->sink->startPlauying(subsession->readSource,NULL,subsession);
>8. rtspClient->playMediaSession(...);
>
>I'm ending streams like this:
>  rtspClient_->teardownMediaSession(*mediaSession_);
>
>  MediaSubsessionIterator iter(*mediaSession_);
>  MediaSubsession *subsession = iter.next();
>
>
>  while (subsession != NULL)
>        {
>         subsession->sink->stopPlaying();
>         Medium::close(subsession->sink);
>         subsession->sink = NULL;
>         subsession = iter.next();
>        }
>
>  MediaSession::close(mediaSession_);
>  mediaSession_ = NULL;
>
>
>Did I miss something?

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.)
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20091023/7cf0ad80/attachment.html>


More information about the live-devel mailing list