mirror of
https://github.com/Omni-guides/Jackify.git
synced 2026-06-17 14:27:44 +02:00
Release v0.6.0
This commit is contained in:
@@ -3,9 +3,12 @@ Main window dialogs and cleanup mixin.
|
||||
Settings, About, open URL, cleanup_processes, closeEvent.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from jackify.frontends.gui.dialogs.settings_dialog import SettingsDialog
|
||||
|
||||
|
||||
@@ -21,6 +24,17 @@ class MainWindowDialogsMixin:
|
||||
except RuntimeError:
|
||||
return None
|
||||
|
||||
# Disconnect all signals before stopping to prevent callbacks to a dying widget.
|
||||
try:
|
||||
thread.finished.disconnect()
|
||||
except Exception:
|
||||
pass
|
||||
for _sig in ("update_available", "no_update", "check_failed", "cache_ready", "progress_update"):
|
||||
try:
|
||||
getattr(thread, _sig).disconnect()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
thread.requestInterruption()
|
||||
except Exception:
|
||||
@@ -37,14 +51,9 @@ class MainWindowDialogsMixin:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
thread.terminate()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
if not thread.wait(10000):
|
||||
print(f"WARNING: {thread_name} still running during shutdown")
|
||||
logger.warning("%s still running during shutdown", thread_name)
|
||||
except Exception:
|
||||
pass
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user