fixed closing applications when closing the gui
This commit is contained in:
@@ -3683,13 +3683,11 @@ class WineHelperGUI(QMainWindow):
|
||||
msg_box.exec_()
|
||||
|
||||
if msg_box.clickedButton() == yes_button:
|
||||
# Корректно завершаем все дочерние процессы
|
||||
for desktop_path, process in list(self.running_apps.items()):
|
||||
if process.state() == QProcess.Running:
|
||||
print(f"Завершение процесса для {desktop_path}...")
|
||||
process.terminate()
|
||||
if not process.waitForFinished(2000): # Ждем 2 сек
|
||||
process.kill() # Если не закрылся, убиваем
|
||||
# Используем встроенную команду killall для надежного завершения всех процессов wine
|
||||
print("Завершение всех запущенных приложений через 'winehelper killall'...")
|
||||
kill_proc = QProcess()
|
||||
kill_proc.start(self.winehelper_path, ["killall"])
|
||||
kill_proc.waitForFinished(5000) # Даем до 5 секунд на завершение
|
||||
event.accept()
|
||||
else:
|
||||
event.ignore()
|
||||
|
Reference in New Issue
Block a user