Fixed interlocking problem in message post-hook.

Fixed transport cleanup in RTP session.


git-svn-id: http://voip.null.ro/svn/yate@627 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2005-12-30 17:45:30 +00:00
parent 6f94543392
commit df033e3e87
2 changed files with 9 additions and 8 deletions

View File

@ -334,12 +334,7 @@ RTPSession::~RTPSession()
DDebug(DebugInfo,"RTPSession::~RTPSession() [%p]",this);
direction(FullStop);
group(0);
if (m_transport) {
RTPTransport* tmp = m_transport;
m_transport = 0;
tmp->setProcessor(0);
delete tmp;
}
transport(0);
}
void RTPSession::timerTick(const Time& when)
@ -438,8 +433,12 @@ void RTPSession::transport(RTPTransport* trans)
DDebug(DebugInfo,"RTPSession::transport(%p) old=%p [%p]",trans,m_transport,this);
if (trans == m_transport)
return;
if (m_transport)
m_transport->setProcessor(0);
RTPTransport* tmp = m_transport;
m_transport = 0;
if (tmp) {
tmp->setProcessor(0);
tmp->destruct();
}
m_transport = trans;
if (m_transport)
m_transport->setProcessor(this);

View File

@ -396,10 +396,12 @@ unsigned int MessageDispatcher::handlerCount()
void MessageDispatcher::setHook(MessagePostHook* hook, bool remove)
{
m_mutex.lock();
if (remove)
m_hooks.remove(hook,false);
else
m_hooks.append(hook);
m_mutex.unlock();
}
/* vi: set ts=8 sw=4 sts=4 noet: */