From 1168e5ae89cf86817d8758aeaac4a2da1aea55b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Sun, 8 Jan 2023 03:39:52 +0100 Subject: [PATCH] correctly cleanup RTCRuntime (#26) --- webrtc-sys/src/webrtc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webrtc-sys/src/webrtc.cpp b/webrtc-sys/src/webrtc.cpp index 9dbddb3..a7d69fd 100644 --- a/webrtc-sys/src/webrtc.cpp +++ b/webrtc-sys/src/webrtc.cpp @@ -8,7 +8,6 @@ namespace livekit { RTCRuntime::RTCRuntime() { - // rtc::LogMessage::LogToDebug(rtc::LS_INFO); RTC_LOG(LS_INFO) << "RTCRuntime()"; RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()"; @@ -25,7 +24,13 @@ RTCRuntime::RTCRuntime() { RTCRuntime::~RTCRuntime() { RTC_LOG(LS_INFO) << "~RTCRuntime()"; + + rtc::ThreadManager::Instance()->SetCurrentThread(nullptr); RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()"; + + worker_thread_->Stop(); + signaling_thread_->Stop(); + network_thread_->Stop(); } rtc::Thread* RTCRuntime::network_thread() const {