BugFix: crashes when exceptions are thrown during destruction #3402

This commit is contained in:
xia-chu 2024-03-22 20:29:22 +08:00
parent 5a137f8b8e
commit 1a3a30dd63
1 changed files with 7 additions and 1 deletions

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);