修复访问悬垂指针的可能

This commit is contained in:
xiongziliang 2020-06-28 15:21:41 +08:00
parent e89caa2385
commit f67e9fce9a

View File

@ -73,11 +73,6 @@ RtpProcess::RtpProcess(uint32_t ssrc) {
} }
RtpProcess::~RtpProcess() { RtpProcess::~RtpProcess() {
DebugP(this);
if (_addr) {
delete _addr;
}
uint64_t duration = (_last_rtp_time.createdTime() - _last_rtp_time.elapsedTime()) / 1000; uint64_t duration = (_last_rtp_time.createdTime() - _last_rtp_time.elapsedTime()) / 1000;
WarnP(this) << "RTP推流器(" WarnP(this) << "RTP推流器("
<< _media_info._vhost << "/" << _media_info._vhost << "/"
@ -90,6 +85,11 @@ RtpProcess::~RtpProcess() {
if (_total_bytes > iFlowThreshold * 1024) { if (_total_bytes > iFlowThreshold * 1024) {
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _media_info, _total_bytes, duration, false, static_cast<SockInfo &>(*this)); NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _media_info, _total_bytes, duration, false, static_cast<SockInfo &>(*this));
} }
if (_addr) {
delete _addr;
_addr = nullptr;
}
} }
bool RtpProcess::inputRtp(const Socket::Ptr &sock, const char *data, int data_len,const struct sockaddr *addr,uint32_t *dts_out) { bool RtpProcess::inputRtp(const Socket::Ptr &sock, const char *data, int data_len,const struct sockaddr *addr,uint32_t *dts_out) {