Fixed web hangup

This commit is contained in:
WolverinDEV 2020-04-02 20:12:29 +02:00
parent 702dd87c41
commit e439d4bc39

View File

@ -457,8 +457,11 @@ void WebClient::handleMessage(const std::string &message) {
unique_lock voice_bridge_lock(this->voice_bridge_lock); unique_lock voice_bridge_lock(this->voice_bridge_lock);
if(this->voice_bridge) { if(this->voice_bridge) {
logError(this->server->getServerId(), "[{}] Tried to register a WebRTC channel twice!", CLIENT_STR_LOG_PREFIX_(this)); logError(this->server->getServerId(), "[{}] Tried to register a WebRTC channel twice!", CLIENT_STR_LOG_PREFIX_(this));
//return;
this->voice_bridge = nullptr; std::thread([&, vb_ptr = std::move(this->voice_bridge), lock = this->ref()]() mutable {
vb_ptr = nullptr;
lock = nullptr;
}).detach();
} }
//TODO test if bridge already exists! //TODO test if bridge already exists!
this->voice_bridge = make_unique<web::VoiceBridge>(dynamic_pointer_cast<WebClient>(_this.lock())); //FIXME Add config this->voice_bridge = make_unique<web::VoiceBridge>(dynamic_pointer_cast<WebClient>(_this.lock())); //FIXME Add config