Skip to content

Commit

Permalink
fix: 修复双击关闭按钮后闪退的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Jan 21, 2025
1 parent f4bd23d commit a8508cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Magpie/XamlWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ class XamlWindowT : public WindowBaseT<T> {
}
case WM_DESTROY:
{
// 防止双击关闭按钮时崩溃。崩溃发生在 XAML Islands 内部,Win10 和 Win11 上都可以复现。
EnableWindow(this->Handle(), FALSE);

_xamlSourceNative2 = nullptr;
// 必须手动重置 Content,否则会内存泄露,使 RootPage 无法析构
_xamlSource.Content(nullptr);
Expand Down

0 comments on commit a8508cb

Please sign in to comment.