[Live-devel] ~RTSPClient() may casue problems when doing some session management

Brain Lai brainlai1102 at gmail.com
Mon Aug 21 09:20:56 PDT 2006


Dear Sir:

In

00145 RTSPClient::~RTSPClient() {
00146   reset();
00147   envir().taskScheduler().turnOffBackgroundReadHandling(fInputSocketNum);
00148   delete[] fResponseBuffer;
00149   delete[] fUserAgentHeaderStr;
00150 },

I note reset() calls closeTCPSockets() to set fIinputSocketNum =
fOutputSocketNum = -1 which causes the following
turnOffBackgroundReadHandling(fInputSocketNum) not to clear
fInputSocketNum in the fReadset of
envir().taskScheduler(). As a result, after ~RTCPClient(), the select() in
SingleStep() returns -1 with errno == EBADF and leads the program to exit!

It seems that changing their order can avoid this problem and people can
happily control the life cycle of the instances of RTSPClient in another
select callback in SingleStep(). Hope this helpful for you. I may not
consider everything clearly, just be careful.

BR.
Brain Lai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20060821/0c67d072/attachment.html 


More information about the live-devel mailing list