From 3651609a5fa0ca14682702472d0ff805c2df6b4e Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 26 Apr 2020 19:09:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E4=BF=9Dmk=5Fplayer=5Frelease?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E5=86=8D=E8=A7=A6=E5=8F=91=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/source/mk_player.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/source/mk_player.cpp b/api/source/mk_player.cpp index 37803de1..f4b6bf7c 100755 --- a/api/source/mk_player.cpp +++ b/api/source/mk_player.cpp @@ -45,6 +45,13 @@ public: }); } + void unset(){ + lock_guard lck(_mtx); + _on_play = nullptr; + _on_shutdown = nullptr; + _on_data = nullptr; + } + void onEvent(bool is_shutdown, const SockException &ex){ lock_guard 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; }