Skip to content

Commit

Permalink
Fixed SEGFAULT
Browse files Browse the repository at this point in the history
  • Loading branch information
Laky-64 committed Nov 16, 2024
1 parent b816f4f commit 2a65c53
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ntgcalls/src/instances/call_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace ntgcalls {
CallInterface::~CallInterface() {
RTC_LOG(LS_VERBOSE) << "Destroying CallInterface";
isExiting = true;
networkThread->BlockingCall([this] {
updateThread->BlockingCall([this] {
std::lock_guard lock(mutex);
connectionChangeCallback = nullptr;
streamManager = nullptr;
Expand Down Expand Up @@ -103,7 +103,7 @@ namespace ntgcalls {
RTC_LOG(LS_INFO) << "Connecting...";
(void) connectionChangeCallback({CallNetworkState::ConnectionState::Connecting, kind});
connection->onConnectionChange([this, kind](const wrtc::ConnectionState state) {
networkThread->PostTask([this, kind, state] {
updateThread->PostTask([this, kind, state] {
if (isExiting) return;
std::lock_guard lock(mutex);
switch (state) {
Expand All @@ -124,11 +124,9 @@ namespace ntgcalls {
case wrtc::ConnectionState::Disconnected:
case wrtc::ConnectionState::Failed:
case wrtc::ConnectionState::Closed:
updateThread->PostTask([this] {
if (connection) {
connection->onConnectionChange(nullptr);
}
});
if (connection) {
connection->onConnectionChange(nullptr);
}
if (state == wrtc::ConnectionState::Failed) {
RTC_LOG(LS_ERROR) << "Connection failed";
(void) connectionChangeCallback({CallNetworkState::ConnectionState::Failed, kind});
Expand Down

0 comments on commit 2a65c53

Please sign in to comment.