提交 4849d045 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Fix port leak (fixes #259)

上级 c4ddf961
...@@ -59,8 +59,9 @@ namespace RTC ...@@ -59,8 +59,9 @@ namespace RTC
{ {
auto* transport = it->second; auto* transport = it->second;
it = this->transports.erase(it); // Do not delete the Transport but call to its Close() method so it will call us
delete transport; // on OnTransportClosed() and will delete it there.
transport->Close();
} }
// Close the audio level timer. // Close the audio level timer.
...@@ -594,7 +595,9 @@ namespace RTC ...@@ -594,7 +595,9 @@ namespace RTC
return; return;
} }
delete transport; // Do not delete the Transport but call to its Close() method so it will call us
// on OnTransportClosed() and will delete it there.
transport->Close();
MS_DEBUG_DEV("Transport closed [transportId:%" PRIu32 "]", transport->transportId); MS_DEBUG_DEV("Transport closed [transportId:%" PRIu32 "]", transport->transportId);
...@@ -1595,6 +1598,8 @@ namespace RTC ...@@ -1595,6 +1598,8 @@ namespace RTC
MS_TRACE(); MS_TRACE();
this->transports.erase(transport->transportId); this->transports.erase(transport->transportId);
delete transport;
} }
void Router::OnProducerClosed(RTC::Producer* producer) void Router::OnProducerClosed(RTC::Producer* producer)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论