diff --git a/src/rtp/rtp_packet.cpp b/src/rtp/rtp_packet.cpp index a85afa2..165316d 100644 --- a/src/rtp/rtp_packet.cpp +++ b/src/rtp/rtp_packet.cpp @@ -62,7 +62,7 @@ RtpPacket::RtpPacket(RtpPacket &&rtp_packet) RtpPacket &RtpPacket::operator=(const RtpPacket &rtp_packet) { if (&rtp_packet != this) { if (buffer_) { - delete buffer_; + delete[] buffer_; buffer_ = nullptr; } buffer_ = new uint8_t[rtp_packet.size_]; @@ -88,13 +88,13 @@ RtpPacket &RtpPacket::operator=(RtpPacket &&rtp_packet) { RtpPacket::~RtpPacket() { if (buffer_) { - delete buffer_; + delete[] buffer_; buffer_ = nullptr; } size_ = 0; if (extension_data_) { - delete extension_data_; + delete[] extension_data_; extension_data_ = nullptr; } extension_len_ = 0; diff --git a/src/transmission/ice_transmission.cpp b/src/transmission/ice_transmission.cpp index 7074bf5..5341712 100644 --- a/src/transmission/ice_transmission.cpp +++ b/src/transmission/ice_transmission.cpp @@ -197,7 +197,11 @@ int IceTransmission::JoinTransmission() { } int IceTransmission::GatherCandidates() { - ice_agent_->GatherCandidates(); + int ret = ice_agent_->GatherCandidates(); + while (ret) { + LOG_ERROR("Gather candidates failed, retry"); + ret = ice_agent_->GatherCandidates(); + } LOG_INFO("[{}] Gather candidates", user_id_); return 0; }