mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 04:08:57 +08:00
确保mk_player_release后不再触发回调
This commit is contained in:
parent
ff7cf5f4d3
commit
3651609a5f
@ -45,6 +45,13 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
void unset(){
|
||||
lock_guard<recursive_mutex> lck(_mtx);
|
||||
_on_play = nullptr;
|
||||
_on_shutdown = nullptr;
|
||||
_on_data = nullptr;
|
||||
}
|
||||
|
||||
void onEvent(bool is_shutdown, const SockException &ex){
|
||||
lock_guard<recursive_mutex> lck(_mtx);
|
||||
if(is_shutdown){
|
||||
@ -125,6 +132,7 @@ API_EXPORT mk_player API_CALL mk_player_create() {
|
||||
API_EXPORT void API_CALL mk_player_release(mk_player ctx) {
|
||||
assert(ctx);
|
||||
MediaPlayerForC::Ptr *obj = (MediaPlayerForC::Ptr *)ctx;
|
||||
(*obj)->unset();
|
||||
delete obj;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user