防止析构时抛异常导致的崩溃

This commit is contained in:
xiongziliang
2023-11-04 22:24:55 +08:00
parent 9f28384cd9
commit 2206b031a9
2 changed files with 13 additions and 3 deletions

View File

@@ -34,8 +34,12 @@ MP4Recorder::MP4Recorder(const string &path, const string &vhost, const string &
}
MP4Recorder::~MP4Recorder() {
flush();
closeFile();
try {
flush();
closeFile();
} catch (std::exception &ex) {
WarnL << ex.what();
}
}
void MP4Recorder::createFile() {