Fix process died Log-Spam

main
Peter Repukat 3 years ago
parent 86d9a172db
commit f5b71bf9c9

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

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

Loading…
Cancel
Save