diff --git a/GlosSITarget/AppLauncher.cpp b/GlosSITarget/AppLauncher.cpp index 80e92c4..6f07ab2 100644 --- a/GlosSITarget/AppLauncher.cpp +++ b/GlosSITarget/AppLauncher.cpp @@ -49,7 +49,7 @@ void AppLauncher::launchApp(const std::wstring& path, const std::wstring& args) void AppLauncher::update() { - if (process_check_clock_.getElapsedTime().asSeconds() > 1) { + if (process_check_clock_.getElapsedTime().asSeconds() > 1 && !logged_process_died_) { #ifdef _WIN32 if (process_info.dwProcessId > 0) { if (!IsProcessRunning(process_info.dwProcessId)) { @@ -58,6 +58,7 @@ void AppLauncher::update() spdlog::info("Configured to close on exit. Shutting down.."); shutdown_(); } + logged_process_died_ = true; } } if (uwp_pid_ > 0) { @@ -67,6 +68,7 @@ void AppLauncher::update() spdlog::info("Configured to close on exit. Shutting down..."); shutdown_(); } + logged_process_died_ = true; } } #endif diff --git a/GlosSITarget/AppLauncher.h b/GlosSITarget/AppLauncher.h index 99bf685..657e503 100644 --- a/GlosSITarget/AppLauncher.h +++ b/GlosSITarget/AppLauncher.h @@ -34,8 +34,8 @@ class AppLauncher { private: std::function shutdown_; - sf::Clock process_check_clock_; + bool logged_process_died_ = false; #ifdef _WIN32 static bool IsProcessRunning(DWORD pid);