v1.8.81: fix update apply — os._exit(0) to kill daemon threads
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
17
gui/app.py
17
gui/app.py
@@ -347,8 +347,7 @@ class App(ctk.CTk):
|
||||
|
||||
if event_type == "auto_apply":
|
||||
# Full-auto mode: apply immediately
|
||||
if self.updater.apply_update(path):
|
||||
self.destroy()
|
||||
self._apply_update(path)
|
||||
return
|
||||
|
||||
# Show banner
|
||||
@@ -399,9 +398,19 @@ class App(ctk.CTk):
|
||||
)
|
||||
|
||||
def _apply_update(self, path: str):
|
||||
"""Apply downloaded update."""
|
||||
"""Apply downloaded update — cleanup, launch updater script, force exit."""
|
||||
import os, sys
|
||||
if self.updater.apply_update(path):
|
||||
self.destroy()
|
||||
# Full cleanup before exit
|
||||
try:
|
||||
self.session_pool.disconnect_all()
|
||||
self.checker.stop()
|
||||
self.updater.stop()
|
||||
self.destroy()
|
||||
except Exception:
|
||||
pass
|
||||
# Force terminate — daemon threads keep process alive otherwise
|
||||
os._exit(0)
|
||||
|
||||
def _skip_update(self, version: str):
|
||||
"""Skip this version."""
|
||||
|
||||
Reference in New Issue
Block a user