From a8508cbe213836ea920f94e17db200cdda033aee Mon Sep 17 00:00:00 2001 From: Xu Date: Tue, 21 Jan 2025 20:57:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=8C=E5=87=BB?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE=E5=90=8E=E9=97=AA=E9=80=80?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Magpie/XamlWindow.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Magpie/XamlWindow.h b/src/Magpie/XamlWindow.h index b294d6e60..8c2b473a0 100644 --- a/src/Magpie/XamlWindow.h +++ b/src/Magpie/XamlWindow.h @@ -373,6 +373,9 @@ class XamlWindowT : public WindowBaseT { } case WM_DESTROY: { + // 防止双击关闭按钮时崩溃。崩溃发生在 XAML Islands 内部,Win10 和 Win11 上都可以复现。 + EnableWindow(this->Handle(), FALSE); + _xamlSourceNative2 = nullptr; // 必须手动重置 Content,否则会内存泄露,使 RootPage 无法析构 _xamlSource.Content(nullptr);