mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 12:05:58 +08:00
防止析构函数抛异常导致崩溃问题 (#2546)
This commit is contained in:
@@ -202,7 +202,11 @@ PlayerProxy::~PlayerProxy() {
|
||||
_timer.reset();
|
||||
// 避免析构时, 忘记回调api请求
|
||||
if (_on_play) {
|
||||
_on_play(SockException(Err_shutdown, "player proxy close"));
|
||||
try {
|
||||
_on_play(SockException(Err_shutdown, "player proxy close"));
|
||||
} catch (std::exception &ex) {
|
||||
WarnL << "Exception occurred: " << ex.what();
|
||||
}
|
||||
_on_play = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user