Closed tony-wolff closed 1 year ago
The Process
python class is a subclass of QProcess
, so calling the kill()
method should work.
That's what I'm doing whit this
for process in self.process_logic.processLists["Running"]: process.kill()
for process in self.process_logic.processLists["Completed"]: process.kill()
for process in self.process_logic.processLists["Failed"]: process.kill()
for process in self.process_logic.processLists["Pending"]: process.kill()
However, when I use the top command in my terminal, I still see the process running at 300% cpu power
It seems that the process created another process, with almost the same PID, and the pattern is that the child gets +10 on the parent PID. So I os.kill this pid and then I used self.regProcess.kill() to finish it, and it works.
I launched a registration with this extension. I have a button cancel, that kills the registration process obtained like this :
self.regProcess = RegistrationProcess(scriptPath, fixed_image, moving_image, input)
with registrationProcess is a subclass of Process. The problem is I believe it does not correctly finish, since my ram and processor is used quite much. How can I properly cancel a parallel process ?