Skip to content
Snippets Groups Projects
Commit 90c4059b authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #6596: AudioSymmetricSession shouldn't self-delete

This lead to a dead-lock in its destructor. Instead, AudioRtpFactory
must delete it.
parent d8864d3b
No related branches found
No related tags found
No related merge requests found
......@@ -172,6 +172,7 @@ void AudioRtpFactory::stop (void)
}
_rtpSession->stopRtpThread();
delete _rtpSession;
_rtpSession = NULL;
} catch (...) {
......
......@@ -302,14 +302,13 @@ int AudioRtpSession::startRtpThread (AudioCodec* audiocodec)
void AudioRtpSession::stopRtpThread ()
{
_queue->disableStack();
if (_type != Zrtp) {
AudioSymmetricRtpSession *self = dynamic_cast<AudioSymmetricRtpSession*>(this);
assert(self);
_debug ("AudioSymmetricRtpSession: Stopping main thread");
self->stopSymmetricRtpThread();
}
_queue->disableStack();
}
......
......@@ -62,9 +62,6 @@ AudioSymmetricRtpSession::~AudioSymmetricRtpSession()
void AudioSymmetricRtpSession::final()
{
delete _rtpThread;
// See: http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.15
delete this;
}
AudioSymmetricRtpSession::AudioRtpThread::AudioRtpThread (AudioSymmetricRtpSession *session) : running (true), rtpSession (session)
......@@ -74,7 +71,6 @@ AudioSymmetricRtpSession::AudioRtpThread::AudioRtpThread (AudioSymmetricRtpSessi
AudioSymmetricRtpSession::AudioRtpThread::~AudioRtpThread()
{
ost::Thread::terminate();
_debug ("AudioSymmetricRtpSession: Delete rtp thread");
}
......
......@@ -55,7 +55,6 @@ using std::ptrdiff_t;
namespace sfl
{
// class AudioSymmetricRtpSession : protected ost::Thread, public ost::TimerPort, public AudioRtpRecordHandler, public ost::TRTPSessionBase<ost::DualRTPUDPIPv4Channel,ost::DualRTPUDPIPv4Channel,ost::AVPQueue>
class AudioSymmetricRtpSession : public ost::TimerPort, public ost::SymmetricRTPSession, public AudioRtpSession
{
public:
......@@ -69,9 +68,6 @@ class AudioSymmetricRtpSession : public ost::TimerPort, public ost::SymmetricRTP
virtual void final ();
// Thread associated method
// virtual void run ();
virtual bool onRTPPacketRecv (ost::IncomingRTPPkt& pkt) { return AudioRtpSession::onRTPPacketRecv(pkt); }
int startSymmetricRtpThread (void) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment