2
0
mirror of https://github.com/Alia5/GlosSI.git synced 2024-11-10 19:10:46 +00:00

Fix process died Log-Spam

This commit is contained in:
Peter Repukat 2021-11-12 13:12:11 +01:00
parent 86d9a172db
commit f5b71bf9c9
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -34,8 +34,8 @@ class AppLauncher {
private:
std::function<void()> shutdown_;
sf::Clock process_check_clock_;
bool logged_process_died_ = false;
#ifdef _WIN32
static bool IsProcessRunning(DWORD pid);