From a92ef263eac5c15da7578daedd2ea99b486354ac Mon Sep 17 00:00:00 2001 From: JohnMcPMS Date: Wed, 5 Nov 2025 16:15:57 -0800 Subject: [PATCH] Unregister signal handler (#5861) ## Change Remove the CTRL handler when we destruct. --- src/AppInstallerCLICore/ShutdownMonitoring.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/AppInstallerCLICore/ShutdownMonitoring.cpp b/src/AppInstallerCLICore/ShutdownMonitoring.cpp index cb581116ec..c7122bf66f 100644 --- a/src/AppInstallerCLICore/ShutdownMonitoring.cpp +++ b/src/AppInstallerCLICore/ShutdownMonitoring.cpp @@ -101,6 +101,8 @@ namespace AppInstaller::ShutdownMonitoring TerminationSignalHandler::~TerminationSignalHandler() { + SetConsoleCtrlHandler(StaticCtrlHandlerFunction, FALSE); + // std::thread requires that any managed thread (joinable) be joined or detached before destructing if (m_windowThread.joinable()) {