correctly cleanup RTCRuntime (#26)

This commit is contained in:
Théo Monnom
2023-01-08 03:39:52 +01:00
committed by GitHub
parent 35816180d9
commit 1168e5ae89
+6 -1
View File
@@ -8,7 +8,6 @@
namespace livekit { namespace livekit {
RTCRuntime::RTCRuntime() { RTCRuntime::RTCRuntime() {
// rtc::LogMessage::LogToDebug(rtc::LS_INFO);
RTC_LOG(LS_INFO) << "RTCRuntime()"; RTC_LOG(LS_INFO) << "RTCRuntime()";
RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()"; RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()";
@@ -25,7 +24,13 @@ RTCRuntime::RTCRuntime() {
RTCRuntime::~RTCRuntime() { RTCRuntime::~RTCRuntime() {
RTC_LOG(LS_INFO) << "~RTCRuntime()"; RTC_LOG(LS_INFO) << "~RTCRuntime()";
rtc::ThreadManager::Instance()->SetCurrentThread(nullptr);
RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()"; RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()";
worker_thread_->Stop();
signaling_thread_->Stop();
network_thread_->Stop();
} }
rtc::Thread* RTCRuntime::network_thread() const { rtc::Thread* RTCRuntime::network_thread() const {