[Live-devel] crash when close rtspserver
ChaseopIm
imcs at telcoware.com
Mon May 11 23:31:54 PDT 2015
Hi.
I found crash when RTSPServer is closed.
I found that RTSPServer::~RTSPServer added some code about closing
fTCPStreamingDatabase in last version.
The code occurred problem, because deleted fTCPStreamingDatabase is used
when closing client connection objects.
(RTSPServer::RTSPClientConnection::closeSockets() calls
fOurServer.stopTCPStreamingOnSocket(fClientOutputSocket);)
When I changed code like below, it's no problem.
RTSPServer::~RTSPServer() {
// Turn off background read handling:
envir().taskScheduler().turnOffBackgroundReadHandling(fRTSPServerSocket);
::closeSocket(fRTSPServerSocket);
envir().taskScheduler().turnOffBackgroundReadHandling(fHTTPServerSocket);
::closeSocket(fHTTPServerSocket);
// Close all client session objects:
RTSPServer::RTSPClientSession* clientSession;
while ((clientSession =
(RTSPServer::RTSPClientSession*)fClientSessions->getFirst()) != NULL) {
delete clientSession;
}
delete fClientSessions;
// Close all client connection objects:
RTSPServer::RTSPClientConnection* connection;
while ((connection =
(RTSPServer::RTSPClientConnection*)fClientConnections->getFirst()) != NULL)
{
delete connection;
}
delete fClientConnections;
delete fClientConnectionsForHTTPTunneling; // all content was already
removed as a result of the loop above
// Delete all server media sessions
ServerMediaSession* serverMediaSession;
while ((serverMediaSession =
(ServerMediaSession*)fServerMediaSessions->getFirst()) != NULL) {
removeServerMediaSession(serverMediaSession); // will delete it, because
it no longer has any 'client session' objects using it
}
delete fServerMediaSessions;
// Delete any pending REGISTER requests:
RegisterRequestRecord* registerRequest;
while ((registerRequest =
(RegisterRequestRecord*)fPendingRegisterRequests->getFirst()) != NULL) {
delete registerRequest;
}
delete fPendingRegisterRequests;
// Empty out and close "fTCPStreamingDatabase":
streamingOverTCPRecord* sotcp;
while ((sotcp =
(streamingOverTCPRecord*)fTCPStreamingDatabase->getFirst()) != NULL)
{
delete sotcp;
}
delete fTCPStreamingDatabase;
}
Any advice or help would be appreciated.
- ChaSeop Im
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20150512/d4dd6678/attachment.html>
More information about the live-devel
mailing list