From 87353534afc5a20d3691ff3c48f7eed2c54da577 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Mon, 14 Nov 2022 14:04:57 +0800 Subject: [PATCH] fix rtp server process removed server not clear --- src/Rtp/RtpServer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Rtp/RtpServer.cpp b/src/Rtp/RtpServer.cpp index 577130e3..c19070bf 100644 --- a/src/Rtp/RtpServer.cpp +++ b/src/Rtp/RtpServer.cpp @@ -95,6 +95,9 @@ public: if (!process && strong_self->_on_detach) { strong_self->_on_detach(); } + if(process && strong_self->_on_detach){// tcp 链接防止断开不删除rtpServer + process->setOnDetach(std::move(strong_self->_on_detach)); + } if (!process) { // process 未创建,触发rtp server 超时事件 NoticeCenter::Instance().emitEvent(Broadcast::KBroadcastRtpServerTimeout,strong_self->_local_port,strong_self->_stream_id,(int)strong_self->_tcp_mode,strong_self->_re_use_port,strong_self->_ssrc); }