Skip to content

Commit

Permalink
PR #13627 from AviaAv: fix abort in some cases with DDS
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Dec 31, 2024
2 parents e18af41 + f36d92a commit 0bad4a1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions third-party/realdds/src/dds-network-adapter-watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class network_adapter_watcher_singleton
if( new_ips.size() || old_ips.size() )
callbacks.raise( new_ips, old_ips );
}
_th.detach(); // so it's not joinable
LOG_DEBUG( "done waiting for IP changes" );
} );
}
Expand All @@ -72,8 +71,15 @@ class network_adapter_watcher_singleton
~network_adapter_watcher_singleton()
{
_adapter_watcher.reset(); // signal the thread to finish
if( _th.joinable() )
_th.join();
try
{
if (_th.joinable())
_th.join();
}
catch (std::exception& e)
{
LOG_DEBUG("Network adapter watcher termination failed: " << e.what());
}
}

void update_ips( ip_set * p_new_ips = nullptr, ip_set * p_old_ips = nullptr )
Expand Down

0 comments on commit 0bad4a1

Please sign in to comment.