[fix] fix crash: ice worker still has IceWorkMsg::Type::Destroy msg which has not been processed when try to stop ice worker

This commit is contained in:
dijunkun
2024-11-27 22:15:45 +08:00
parent 1b7c8905b7
commit 21737c354a
3 changed files with 18 additions and 20 deletions

View File

@@ -68,8 +68,7 @@ struct IceWorkMsg {
UserLeaveTransmission,
Offer,
Answer,
NewCandidate,
Destroy
NewCandidate
};
Type type;
@@ -97,6 +96,8 @@ class PeerConnection {
int Leave(const std::string &transmission_id);
int ReleaseAllIceTransmission();
int Destroy();
SignalStatus GetSignalStatus();
@@ -201,7 +202,9 @@ class PeerConnection {
std::atomic<bool> ice_worker_running_{true};
std::queue<IceWorkMsg> ice_work_msg_queue_;
std::condition_variable ice_work_cv_;
std::condition_variable empty_notify_cv_;
std::mutex ice_work_mutex_;
std::mutex empty_notify_mutex_;
};
#endif