BugFix: crashes when exceptions are thrown during destruction #3402

This commit is contained in:
xia-chu 2024-03-22 20:29:22 +08:00 committed by 夏楚
parent 66a6253160
commit 5036aa5ec5

View File

@ -29,7 +29,13 @@ public:
getRtmpRing()->setDelegate(_media_src);
}
~RtmpMediaSourceMuxer() override { RtmpMuxer::flush(); }
~RtmpMediaSourceMuxer() override {
try {
RtmpMuxer::flush();
} catch (std::exception &ex) {
WarnL << ex.what();
}
}
void setListener(const std::weak_ptr<MediaSourceEvent> &listener){
setDelegate(listener);