From bb8cc0a305007c68dfccef99f85cc67158107b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Sto=C5=A1i=C4=87?= Date: Tue, 13 Oct 2020 10:26:04 +0200 Subject: [PATCH] Restart the launcher if it had crashed when invoked (#7127) --- src/modules/launcher/Microsoft.Launcher/dllmain.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/launcher/Microsoft.Launcher/dllmain.cpp b/src/modules/launcher/Microsoft.Launcher/dllmain.cpp index c50c951a5e..f4b9f6908b 100644 --- a/src/modules/launcher/Microsoft.Launcher/dllmain.cpp +++ b/src/modules/launcher/Microsoft.Launcher/dllmain.cpp @@ -271,6 +271,12 @@ public: // For now, hotkeyId will always be zero if (m_enabled) { + if (WaitForSingleObject(m_hProcess, 0) == WAIT_OBJECT_0) + { + // The process exited, restart it + enable(); + } + SetEvent(m_hEvent); return true; }