diff options
-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(); } |