防止析构函数抛异常导致崩溃问题 (#2546)

This commit is contained in:
夏楚
2023-06-11 22:07:15 +08:00
committed by GitHub
parent fe37005526
commit 5ca4ed53b2
9 changed files with 33 additions and 14 deletions

View File

@@ -28,7 +28,11 @@ RtpSender::RtpSender(EventPoller::Ptr poller) {
}
RtpSender::~RtpSender() {
flush();
try {
flush();
} catch (std::exception &ex) {
WarnL << "Exception occurred: " << ex.what();
}
}
void RtpSender::startSend(const MediaSourceEvent::SendRtpArgs &args, const function<void(uint16_t local_port, const SockException &ex)> &cb){