[patch] 优化版本管理显示 与 更新提示(修改表名信息) 修复因线程安全问题导致的崩溃
This commit is contained in:
@@ -245,11 +245,18 @@ class WebSocketManager:
|
||||
self._log(f"❌ 启动版本检查器失败: {e}", "ERROR")
|
||||
|
||||
def _on_update_available(self, latest_version, download_url):
|
||||
"""发现新版本时的处理"""
|
||||
"""发现新版本时的处理(在子线程中调用)"""
|
||||
self._log(f"🔔 发现新版本 {latest_version}", "INFO")
|
||||
# 通知主GUI显示更新提醒
|
||||
# 通知主GUI显示更新提醒(通过 Qt 信号机制,线程安全)
|
||||
if hasattr(self, 'gui_update_callback') and self.gui_update_callback:
|
||||
self.gui_update_callback(latest_version, download_url)
|
||||
try:
|
||||
# 直接调用回调(回调内部使用信号机制调度到主线程)
|
||||
self.gui_update_callback(latest_version, download_url)
|
||||
self._log(f"✅ 已调用更新回调", "DEBUG")
|
||||
except Exception as e:
|
||||
self._log(f"❌ 调用更新回调失败: {e}", "ERROR")
|
||||
import traceback
|
||||
self._log(f"详细错误: {traceback.format_exc()}", "ERROR")
|
||||
|
||||
def _start_jd_listener(self, store_id: str, cookies: str):
|
||||
"""启动京东平台监听"""
|
||||
|
||||
Reference in New Issue
Block a user