Skip to content

Commit

Permalink
fix: 修复无法启动的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue authored and eriforce committed Mar 27, 2023
1 parent 842bac7 commit 8bd2ad5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Magpie.Core/MagRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ MagRuntime::~MagRuntime() {

if (_magWindThread.joinable()) {
DWORD magWndThreadId = GetThreadId(_magWindThread.native_handle());
PostThreadMessage(magWndThreadId, WM_QUIT, 0, 0);
// 持续尝试直到 _magWindThread 创建了消息队列
while (!PostThreadMessage(magWndThreadId, WM_QUIT, 0, 0)) {
Sleep(1);
}
_magWindThread.join();
}
}
Expand Down

0 comments on commit 8bd2ad5

Please sign in to comment.