Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
None
Description
This method isn't really sensible and reliable. The current implementation looks like:
void QtcProcess::stopProcess() { if (state() == QProcess::NotRunning) return; terminate(); if (waitForFinished(300)) return; kill(); waitForFinished(300); }
Why not sensible? Do we really care about the safe terminate still relying on signals delivery? If so, why after 300 we resign from it?
Don't we rely on signals delivery? Then we should call close() or delete the process - process termination will be passed to the ProcessReaper.
Why not reliable? It may happen that neither terminate nor kill finished the process and we are in the same state as without calling it.
It looks like we are currently having about 25 usages of this method - they all should be supervised.