From c2ce8536f16d9363b52a40a6e3fd3ad009c5be5b Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 24 Sep 2014 17:24:40 +0000 Subject: [PATCH] Fix infinite loop problems in CAT error shutdown. The TransceiverBase class attempts to turn off PTT on closedown, this was causing an infinite loop if the close down was due to a CAT communications error. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4347 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- TransceiverBase.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/TransceiverBase.cpp b/TransceiverBase.cpp index 4facbe16a..78fa2a295 100644 --- a/TransceiverBase.cpp +++ b/TransceiverBase.cpp @@ -40,13 +40,14 @@ void TransceiverBase::start () noexcept { if (m_->state_.online ()) { + m_->state_.online (false); + // ensure PTT isn't left set do_ptt (false); do_post_ptt (false); do_stop (); do_post_stop (); - m_->state_.online (false); } do_start (); do_post_start (); @@ -73,6 +74,8 @@ void TransceiverBase::stop () noexcept { if (m_->state_.online ()) { + m_->state_.online (false); + // ensure PTT isn't left set do_ptt (false); do_post_ptt (false); @@ -80,7 +83,6 @@ void TransceiverBase::stop () noexcept do_stop (); do_post_stop (); - m_->state_.online (false); } catch (std::exception const& e) { @@ -265,8 +267,13 @@ void TransceiverBase::offline (QString const& reason) if (m_->state_.online ()) { m_->state_.online (false); - do_stop (); + + // ensure PTT isn't left set + do_ptt (false); + do_post_ptt (false); } + do_stop (); + do_post_stop (); } catch (std::exception const& e) {