Skip to content

The only downloader you need. 下载器的集大成者。

fix(ui): 打包版反复开关抽屉和对话框时内存持续上涨

XiaoYouChR34bece87643c
diff --git a/app/view/components/dialog_animation.py b/app/view/components/dialog_animation.py
index 137727e9..1418170e 100644
--- a/app/view/components/dialog_animation.py
+++ b/app/view/components/dialog_animation.py
@@ -58,7 +58,8 @@ class AnimationLayer(QWidget):
layer._animation.stop()
self._backdrop = self._buildBackdrop()
self._animation.valueChanged.connect(self.update)
- self._animation.stateChanged.connect(self._onAnimationStateChanged)
+ # Nuitka 编译后会永久持有连到信号上的绑定方法,用 lambda 这一层和截图才能释放
+ self._animation.stateChanged.connect(lambda state: self._onAnimationStateChanged(state))
# 对话框声明不透明,Qt 就不再重画底下的页面
dialog.setAttribute(Qt.WidgetAttribute.WA_OpaquePaintEvent)
# 关闭时当场截图,窗口最小化时也能关掉