Skip to content

Commit

Permalink
stop cyclic registration thread before sending last (un)registration …
Browse files Browse the repository at this point in the history
…message and udp socket shutdown (fixing #1141)
  • Loading branch information
rex-schilasky committed Jul 17, 2023
1 parent 1137abf commit dd3f1e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ecal/core/src/ecal_registration_provider.cpp
Expand Up @@ -105,6 +105,7 @@ namespace eCAL
m_memfile_broadcast_writer.Bind(&m_memfile_broadcast);
}

// start cyclic registration thread
m_reg_sample_snd_thread.Start(Config::GetRegistrationRefreshMs(), std::bind(&CRegistrationProvider::RegisterSendThread, this));

m_created = true;
Expand All @@ -114,12 +115,15 @@ namespace eCAL
{
if(!m_created) return;

// this is our last (un)registration message to the world
// stop cyclic registration thread
m_reg_sample_snd_thread.Stop();

// send one last (un)registration message to the world
// thank you and goodbye :-)
UnregisterProcess();

// destroy registration sample sender
m_reg_sample_snd.reset();
m_reg_sample_snd_thread.Stop();

if(m_use_shm_monitoring)
{
Expand Down

0 comments on commit dd3f1e8

Please sign in to comment.