Skip to content

Commit

Permalink
chore: 添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Dec 17, 2024
1 parent a2f451a commit 9636ab4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Magpie/ToastService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ void ToastService::_ToastThreadProc() noexcept {
DispatchMessage(&msg);
}

// 不知为何 ToastPage 会泄露,主线程的 RootPage 却不会。
// 确保 ToastPage 析构!
for (auto raw = _toastPage.detach(); raw->Release() != 0;) {}
// !!! HACK !!!
// Win10 中 ToastPage 会泄露,很可能是 XAML Islands 的 bug,但主线程的 RootPage 却不会。
// Win11 没有这个问题。下面的代码确保 ToastPage 能析构!
auto raw = _toastPage.detach();
while (raw->Release() != 0) {}
}

LRESULT ToastService::_ToastWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
Expand Down

0 comments on commit 9636ab4

Please sign in to comment.