diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-20 12:29:44 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-20 12:29:44 +0200 |
commit | 1f2409090a7e60ff4ec3b70a3161f2799d16cad5 (patch) | |
tree | ea4e59ae25e0237628fd03a58096e5f1cb8bb5a4 /src | |
parent | 411d03ac6b8ee1a8c06f952b9378c90516a715b7 (diff) | |
download | dabmod-1f2409090a7e60ff4ec3b70a3161f2799d16cad5.tar.gz dabmod-1f2409090a7e60ff4ec3b70a3161f2799d16cad5.tar.bz2 dabmod-1f2409090a7e60ff4ec3b70a3161f2799d16cad5.zip |
Fix thread teardown in RC
Diffstat (limited to 'src')
-rw-r--r-- | src/RemoteControl.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp index a3d9ec3..f7fff50 100644 --- a/src/RemoteControl.cpp +++ b/src/RemoteControl.cpp @@ -48,7 +48,14 @@ RemoteControllerTelnet::~RemoteControllerTelnet() { m_active = false; m_io_service.stop(); - m_child_thread.join(); + + if (m_restarter_thread.joinable()) { + m_restarter_thread.join(); + } + + if (m_child_thread.joinable()) { + m_child_thread.join(); + } } void RemoteControllerTelnet::restart() @@ -341,6 +348,10 @@ RemoteControllerZmq::~RemoteControllerZmq() { m_active = false; m_fault = false; + if (m_restarter_thread.joinable()) { + m_restarter_thread.join(); + } + if (m_child_thread.joinable()) { m_child_thread.join(); } |