[Live-devel] Proper Way to Delete a ServerMediaSession

brian_wang brian_wang at coventive.com
Thu Jan 13 16:37:56 PST 2005


Hello all,

What is the proper way to remove a session from the RTSP server?
I am using the latest release:
    live.2005.01.07.tar.gz

I tried:
    RTSPServer::removeServerMediaSession(...)
However, it gives segmentation fault error.

A simple test can be done by adding in testOnDemandRTSPServer.cpp:
    rtspServer->removeServerMediaSession(sms);
right after adding a session.

Is it the correct way to remove a session or I am doing something very
wrong?

The seg fault is triggered at (when removing a 
MPEG2TransportFileServerMediaSubsession):
    ~OnDemandServerMediaSubsession() {
        ...
        delete[] fDestinationsHashTable;  // <- This line
    }

Changing the line to
    delete fDestinationsHashTable;
works fine.  Why is it deleting the hash table as an array?
Not being C++ savvy, I am not too sure about the modification.

Thanks in advance. :-)


brian




More information about the live-devel mailing list