From 0e096895d6989fef9f35c6a001358836db3825e9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 9 Feb 2019 12:12:28 +0100 Subject: proto/simconnect: don't hang so long on exit Issue: #804 --- proto-simconnect/ftnoir_protocol_sc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'proto-simconnect') diff --git a/proto-simconnect/ftnoir_protocol_sc.cpp b/proto-simconnect/ftnoir_protocol_sc.cpp index b94d8769..9a1db9b5 100644 --- a/proto-simconnect/ftnoir_protocol_sc.cpp +++ b/proto-simconnect/ftnoir_protocol_sc.cpp @@ -76,8 +76,12 @@ void simconnect::run() (void)simconnect_close(handle); } - if (!isInterruptionRequested()) - Sleep(sleep_time * 1000); + for (unsigned k = 0; k < sleep_time * 25; k++) + { + if (isInterruptionRequested()) + break; + Sleep(1000 / 25); + } } qDebug() << "simconnect: exit"; -- cgit v1.2.3