mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
fix: 更好的解决双击关闭按钮闪退问题
This commit is contained in:
parent
536935a57e
commit
f6a8e737bf
1 changed files with 2 additions and 4 deletions
|
|
@ -373,8 +373,8 @@ protected:
|
|||
}
|
||||
case WM_DESTROY:
|
||||
{
|
||||
// 防止双击关闭按钮时崩溃。崩溃发生在 XAML Islands 内部,Win10 和 Win11 上都可以复现。
|
||||
EnableWindow(this->Handle(), FALSE);
|
||||
// 确保关闭过程中 _content 已经为空
|
||||
_content = nullptr;
|
||||
|
||||
_xamlSourceNative2 = nullptr;
|
||||
// 必须手动重置 Content,否则会内存泄露,使 RootPage 无法析构
|
||||
|
|
@ -386,8 +386,6 @@ protected:
|
|||
_isMaximized = false;
|
||||
_isLightTheme = true;
|
||||
|
||||
_content = nullptr;
|
||||
|
||||
Destroyed.Invoke();
|
||||
|
||||
LRESULT ret = base_type::_MessageHandler(msg, wParam, lParam);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue