From e439d4bc39871647f5051b8d59706e1e01a5498b Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Thu, 2 Apr 2020 20:12:29 +0200 Subject: [PATCH] Fixed web hangup --- server/src/client/web/WebClient.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/client/web/WebClient.cpp b/server/src/client/web/WebClient.cpp index eafe1be..9ccf464 100644 --- a/server/src/client/web/WebClient.cpp +++ b/server/src/client/web/WebClient.cpp @@ -457,8 +457,11 @@ void WebClient::handleMessage(const std::string &message) { unique_lock voice_bridge_lock(this->voice_bridge_lock); if(this->voice_bridge) { 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! this->voice_bridge = make_unique(dynamic_pointer_cast(_this.lock())); //FIXME Add config