From 31e231beef1030cebf67594ce8987e0664a84dfd Mon Sep 17 00:00:00 2001 From: David Freese Date: Sun, 8 Feb 2015 08:41:29 -0600 Subject: [PATCH] Exit trx loop Changed exit process for trx loop --- src/dialogs/fl_digi.cxx | 11 +---------- src/trx/trx.cxx | 3 ++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/dialogs/fl_digi.cxx b/src/dialogs/fl_digi.cxx index 912024f6..e960b25d 100644 --- a/src/dialogs/fl_digi.cxx +++ b/src/dialogs/fl_digi.cxx @@ -3006,16 +3006,7 @@ bool clean_exit(bool ask) { ADIF_RW_close(); - if (trx_state == STATE_RX || trx_state == STATE_TX || trx_state == STATE_TUNE) - trx_state = STATE_ABORT; - else { - LOG_ERROR("trx in unexpected state %d", trx_state); - exit(1); - } - while (trx_state != STATE_ENDED) { - REQ_FLUSH(GET_THREAD_ID()); - MilliSleep(10); - } + trx_close(); #if USE_HAMLIB if (xcvr) delete xcvr; diff --git a/src/trx/trx.cxx b/src/trx/trx.cxx index 87fe9aee..7906ccda 100644 --- a/src/trx/trx.cxx +++ b/src/trx/trx.cxx @@ -680,7 +680,8 @@ void trx_start(void) void trx_close() { trx_state = STATE_ABORT; - while (trx_state != STATE_ENDED) + int count = 10; + while (trx_state != STATE_ENDED && count--) MilliSleep(100); #if USE_NAMED_SEMAPHORES