fixed closing applications when closing the gui

This commit is contained in:
Sergey Palcheh
2025-09-27 11:08:26 +06:00
parent 5763749aa0
commit e3ac6dd967

View File

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