diff --git a/src/Magpie.Core/ExclModeHelper.cpp b/src/Magpie.Core/ExclModeHelper.cpp index ea9cd92e7..b11953012 100644 --- a/src/Magpie.Core/ExclModeHelper.cpp +++ b/src/Magpie.Core/ExclModeHelper.cpp @@ -30,7 +30,7 @@ wil::unique_mutex_nothrow ExclModeHelper::EnterExclMode() noexcept { return exclModeMutex; } - if (!wil::event_is_signaled(exclModeMutex.get())) { + if (!wil::handle_wait(exclModeMutex.get(), 0)) { Logger::Get().Error("获取 __DDrawExclMode__ 失败"); exclModeMutex.reset(); return exclModeMutex; diff --git a/src/Magpie.Core/ScalingWindow.cpp b/src/Magpie.Core/ScalingWindow.cpp index e7034813e..d59448b5c 100644 --- a/src/Magpie.Core/ScalingWindow.cpp +++ b/src/Magpie.Core/ScalingWindow.cpp @@ -412,8 +412,10 @@ LRESULT ScalingWindow::_MessageHandler(UINT msg, WPARAM wParam, LPARAM lParam) n } case WM_DESTROY: { - _exclModeMutex.ReleaseMutex(); - _exclModeMutex.reset(); + if (_exclModeMutex) { + _exclModeMutex.ReleaseMutex(); + _exclModeMutex.reset(); + } _hwndDDF.reset(); _isDDFWindowShown = false;