Commit d74a1e78 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #6621: Fixed double free, unlock mutex in ManagerImpl::terminate

Also the memory pool for the SDP must be deallocated after we've destroyed
the SDP.
parent f42703aa
......@@ -198,7 +198,7 @@ void ManagerImpl::terminate ()
_debug ("Manager: Unload audio codecs ");
_audioCodecFactory.deleteHandlePointer();
audioLayerMutexUnlock();
}
bool ManagerImpl::isCurrentCall (const std::string& callId)
......
......@@ -648,7 +648,6 @@ Sdp::~Sdp()
for (iter = localAudioMediaCap_.begin(); iter != localAudioMediaCap_.end(); ++iter)
delete *iter;
pj_pool_release (memPool_);
}
......
......@@ -48,7 +48,7 @@ SIPCall::SIPCall (const std::string& id, Call::CallType type, pj_caching_pool *c
, _invSession (NULL)
, pool_(pj_pool_create(&caching_pool->factory, id.c_str(), CALL_MEMPOOL_INIT_SIZE,
CALL_MEMPOOL_INC_SIZE, NULL))
, local_sdp_(pool_)
, local_sdp_(new Sdp(pool_))
{
_debug ("SIPCall: Create new call %s", id.c_str());
}
......@@ -58,6 +58,8 @@ SIPCall::~SIPCall()
_debug ("SIPCall: Delete call");
_debug ("SDP: pool capacity %d", pj_pool_get_capacity (pool_));
_debug ("SDP: pool size %d", pj_pool_get_used_size (pool_));
delete local_sdp_;
pj_pool_release (pool_);
delete _audiortp;
}
......@@ -33,13 +33,13 @@
#define SIPCALL_H
#include "call.h"
#include "sdp.h"
#include <cassert>
class pjsip_evsub;
class pj_caching_pool;
class pj_pool_t;
class pjsip_inv_session;
class Sdp;
namespace sfl
{
......@@ -96,7 +96,7 @@ class SIPCall : public Call
* Return the local SDP session
*/
Sdp* getLocalSDP (void) {
return &local_sdp_;
return local_sdp_;
}
/**
......@@ -169,7 +169,7 @@ class SIPCall : public Call
/**
* The SDP session
*/
Sdp local_sdp_;
Sdp *local_sdp_;
};
#endif
......@@ -114,6 +114,7 @@ void SDPTest::tearDown()
{
delete _session;
_session = NULL;
pj_pool_release (_testPool);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment