fix: 修复双击关闭按钮后闪退的问题

This commit is contained in:
Xu 2025-01-21 20:57:06 +08:00
commit a8508cbe21

View file

@ -373,6 +373,9 @@ protected:
}
case WM_DESTROY:
{
// 防止双击关闭按钮时崩溃。崩溃发生在 XAML Islands 内部Win10 和 Win11 上都可以复现。
EnableWindow(this->Handle(), FALSE);
_xamlSourceNative2 = nullptr;
// 必须手动重置 Content否则会内存泄露使 RootPage 无法析构
_xamlSource.Content(nullptr);