mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-28 21:14:03 +08:00
修复程序退出时访问NoticeCenter单例可能崩溃的bug
This commit is contained in:
@@ -623,10 +623,11 @@ PythonInvoker::PythonInvoker() {
|
||||
}
|
||||
}
|
||||
});
|
||||
_notice_center = NoticeCenter::Instance().shared_from_this();
|
||||
}
|
||||
|
||||
PythonInvoker::~PythonInvoker() {
|
||||
NoticeCenter::Instance().delListener(this, Broadcast::kBroadcastReloadConfig);
|
||||
_notice_center->delListener(this, Broadcast::kBroadcastReloadConfig);
|
||||
{
|
||||
py::gil_scoped_acquire gil; // 加锁
|
||||
if (_on_exit) {
|
||||
|
||||
Reference in New Issue
Block a user