From ce1397b532dd2db95bcf3ad818e67068e4f263f7 Mon Sep 17 00:00:00 2001 From: Jacobwasbeast Date: Tue, 10 Mar 2026 21:37:20 -0500 Subject: [PATCH] fix(runtime): suppress CRT assert dialogs --- WeaveLoaderRuntime/src/dllmain.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WeaveLoaderRuntime/src/dllmain.cpp b/WeaveLoaderRuntime/src/dllmain.cpp index 9f076c4..6a46bb9 100644 --- a/WeaveLoaderRuntime/src/dllmain.cpp +++ b/WeaveLoaderRuntime/src/dllmain.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -17,6 +18,11 @@ static HMODULE g_hModule = nullptr; +static int __cdecl SuppressCrtAssert(int, char*, int*) +{ + return 1; +} + static std::string GetDllDirectory(HMODULE hModule) { char path[MAX_PATH] = {0}; @@ -296,6 +302,8 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv std::string baseDir = GetDllDirectory(hModule); LogUtil::SetBaseDir(baseDir.c_str()); CrashHandler::Install(hModule); + _CrtSetReportMode(_CRT_ASSERT, 0); + _CrtSetReportHook(SuppressCrtAssert); } CreateThread(nullptr, 0, InitThread, nullptr, 0, nullptr);