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