From 463c349fc3df912e440f8009ffd49fad1f7674e0 Mon Sep 17 00:00:00 2001 From: Roberto Viola Date: Fri, 5 Jan 2024 18:31:13 +0000 Subject: [PATCH] Adb.exe stays resident on QZ exit (Windows) (Issue #1951) (#1953) --- src/nordictrackifitadbtreadmill.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/nordictrackifitadbtreadmill.cpp b/src/nordictrackifitadbtreadmill.cpp index ed12fc2b8..b7118176f 100644 --- a/src/nordictrackifitadbtreadmill.cpp +++ b/src/nordictrackifitadbtreadmill.cpp @@ -486,8 +486,19 @@ void nordictrackifitadbtreadmill::changeInclinationRequested(double grade, doubl bool nordictrackifitadbtreadmill::connected() { return true; } void nordictrackifitadbtreadmill::stopLogcatAdbThread() { + qDebug() << "stopLogcatAdbThread()"; + initiateThreadStop(); logcatAdbThread->quit(); + logcatAdbThread->terminate(); + +#ifdef Q_OS_WIN32 + QProcess process; + QString command = "/c wmic process where name='adb.exe' delete"; + process.start("cmd.exe", QStringList(command.split(' '))); + process.waitForFinished(-1); // will wait forever until finished +#endif + logcatAdbThread->wait(); }