Hi Jasem
I wrote code to kill only the current kstars.exe process with taskkill.
I don't know the original Issue so I am not sure if this is really correct.
Do you have a record of that Issue, such as a BTS ticket?
Also, if Qt's own bug is fixed, then this code is also unnecessary.
Before fix
QProcess::execute("taskkill /im kstars.exe /f");
The taskkill command kills all running kstars.exe processes.
After Fix
QProcess::execute("taskkill /pid <Current kstars own PID> /f");
Specifying the PID of the process executing this code itself, taskkill kills a single kstars.exe process.
Patch created by git diff
diff --git a/kstars/kstars.cpp b/kstars/kstars.cpp
index 941e93977..99696b599 100644
--- a/kstars/kstars.cpp
+++ b/kstars/kstars.cpp
@@ -275,7 +275,13 @@ KStars::~KStars()
* Hopefully we do not need this hack once the above bug is resolved.
*/
#ifdef Q_OS_WIN
- QProcess::execute("taskkill /im kstars.exe /f");
+ qint64 kstarsPid = QCoreApplication::applicationPid();
+ QString killCmd;
+ killCmd += "taskkill /pid ";
+ killCmd += QString::number(kstarsPid);
+ killCmd += " /f";
+
+ QProcess::execute(killCmd);
#endif
}