fix a leak in janus connector

pull/135/head
Michael Zanetti 2017-12-14 11:32:08 +01:00
parent 6dc15c611b
commit 68a5798cf9
1 changed files with 2 additions and 3 deletions

View File

@ -231,8 +231,7 @@ void JanusConnector::onReadyRead()
foreach (WebRtcSession *session, m_sessions) {
if (session->matchJanusSessionId(sessionId)) {
qCDebug(dcJanus()) << "Session" << session << "timed out. Removing session";
m_sessions.remove(session->sessionId);
delete session;
delete m_sessions.take(session->sessionId);
return;
}
}
@ -268,7 +267,7 @@ void JanusConnector::onReadyRead()
hangup.insert("type", "hangup");
hangup.insert("reason", map.value("reason").toString());
emit webRtcHandshakeMessageReceived(session->sessionId, hangup);
m_sessions.remove(session->sessionId);
delete m_sessions.take(session->sessionId);
return;
}
}