From a88531354aefb372b0d6a8c560e1f5859b0e348e Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Mon, 13 May 2019 09:36:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87rtp=E7=BB=84=E6=92=AD?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=AE=89=E5=85=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/RtpBroadCaster.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Rtsp/RtpBroadCaster.cpp b/src/Rtsp/RtpBroadCaster.cpp index 1fa0ce33..5b84c06c 100644 --- a/src/Rtsp/RtpBroadCaster.cpp +++ b/src/Rtsp/RtpBroadCaster.cpp @@ -156,7 +156,11 @@ string RtpBroadCaster::getIP(){ } RtpBroadCaster::Ptr RtpBroadCaster::make(const EventPoller::Ptr &poller,const string &strLocalIp,const string &strVhost,const string &strApp,const string &strStream){ try{ - auto ret = Ptr(new RtpBroadCaster(poller,strLocalIp,strVhost,strApp,strStream)); + auto ret = Ptr(new RtpBroadCaster(poller,strLocalIp,strVhost,strApp,strStream),[poller](RtpBroadCaster *ptr){ + poller->async([ptr]() { + delete ptr; + }); + }); lock_guard lck(g_mtx); string strKey = StrPrinter << strLocalIp << " " << strVhost << " " << strApp << " " << strStream << endl; weak_ptr weakPtr = ret;