MT#59962 AmB2BSession: properly clean RTP streams

Properly place the clear RTP receivers handler.
Instead of doing directly from the destructor,
do it on state change (onBeforeDestroy) via
the down to up virtual function realization search.

Is triggered by `AmSession::finalize()`.

Closes Coverity CID 642748.

Change-Id: I4c224425e9fbecedef3d29a6658f1723313b19c4
mr14.1
Donat Zenichev 7 months ago
parent 81f4ec15f0
commit f63b80748f

@ -605,8 +605,12 @@ SBCCallLeg::~SBCCallLeg()
void SBCCallLeg::onBeforeDestroy()
{
for (vector<ExtendedCCInterface*>::iterator i = cc_ext.begin(); i != cc_ext.end(); ++i) {
(*i)->onDestroyLeg(this);
try {
(*i)->onDestroyLeg(this);
}
catch (...) { /* ignore errors */ }
}
CallLeg::onBeforeDestroy();
}
UACAuthCred* SBCCallLeg::getCredentials() {

@ -116,10 +116,15 @@ AmB2BSession::AmB2BSession(const string& other_local_tag, AmSipDialog* p_dlg,
if(!subs) subs = new AmSipSubscription(dlg,this);
}
AmB2BSession::~AmB2BSession()
void AmB2BSession::onBeforeDestroy()
{
// cleanup before the instance is destroyed
clearRtpReceiverRelay();
AmSession::onBeforeDestroy();
}
AmB2BSession::~AmB2BSession()
{
ILOG_DLG(L_DBG, "relayed_req.size() = %zu\n",relayed_req.size());
map<int,AmSipRequest>::iterator it = recvd_req.begin();

@ -342,6 +342,8 @@ private:
virtual ~AmB2BSession();
virtual void onBeforeDestroy();
/** flag to enable RTP relay mode */
RTPRelayMode rtp_relay_mode;
/** force symmetric RTP */

Loading…
Cancel
Save