Skip to content

Commit

Permalink
Merge pull request #6816 from kozlovsky/fix/clicked_force_shutdown_os…
Browse files Browse the repository at this point in the history
…error

Handle OSError in TriblerWindow.clicked_force_shutdown()
  • Loading branch information
kozlovsky authored Mar 18, 2022
2 parents e112e0d + 63d379d commit 1f98d56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tribler/gui/tribler_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
from tribler.core.utilities.unicode import hexlify
from tribler.core.utilities.utilities import parse_query
from tribler.core.version import version_id

from tribler.gui.core_manager import CoreManager
from tribler.gui.debug_window import DebugWindow
from tribler.gui.defs import (
Expand Down Expand Up @@ -1165,7 +1164,10 @@ def clicked_force_shutdown(self):
process_checker = ProcessChecker(self.root_state_dir)
if process_checker.already_running:
core_pid = process_checker.get_pid_from_lock_file()
os.kill(int(core_pid), 9)
try:
os.kill(int(core_pid), 9)
except OSError: # The core process can exit before the GUI process attempts to kill it
pass
# Stop the Qt application
QApplication.quit()

Expand Down

0 comments on commit 1f98d56

Please sign in to comment.