Skip to content

Commit

Permalink
fix: don't trigger multiple messagebox windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenapte committed Nov 24, 2023
1 parent db7a154 commit 23692df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions BallanceMMOClient/dumpfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ namespace NSDumpFile {
}

std::function<void(std::string&)> CrashCallback{};
static bool messageBoxTriggered = false;

LONG WINAPI UnhandledExceptionFilterEx(struct ::_EXCEPTION_POINTERS* pException)
{
Expand All @@ -112,6 +113,8 @@ namespace NSDumpFile {
CreateDumpFile(szFileName, pException);

// TODO: MiniDumpWriteDump
if (messageBoxTriggered)
return EXCEPTION_CONTINUE_SEARCH;
std::string extraText;
CrashCallback(extraText);
if (!extraText.empty())
Expand Down Expand Up @@ -142,6 +145,7 @@ namespace NSDumpFile {
//FatalAppExit(-1, extraText.c_str());
char basename[128];
GetModuleBaseName(GetCurrentProcess(), NULL, basename, sizeof(basename));
messageBoxTriggered = true;
MessageBox(NULL, extraText.c_str(),
(basename + std::string{" - Fatal Application Exit"}).c_str(),
MB_OK | MB_ICONERROR | MB_SYSTEMMODAL | MB_SETFOREGROUND | MB_SERVICE_NOTIFICATION);
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ project(${PROJECT_NAME})
# endif()

set(BMMO_VER_DEFINED 1)
set(BMMO_VER 3.5.7-beta16)
set(BMMO_MIN_CLIENT_VER 3.5.7-beta16)
set(BMMO_VER 3.5.7-beta17)
set(BMMO_MIN_CLIENT_VER 3.5.7-beta17)
set(CONFIG_DIR ${CMAKE_CURRENT_LIST_DIR}/BallanceMMOCommon/include/config)
configure_file(${CONFIG_DIR}/version_config.h.in ${CONFIG_DIR}/version_config.h @ONLY)

Expand Down

0 comments on commit 23692df

Please sign in to comment.