From 00c86fef4f1d64aa439a097e6d2a6b59f11fbe38 Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:51:51 +0100 Subject: [PATCH] [Hosts]Reset Terminate event after closing (#35663) --- src/modules/Hosts/HostsModuleInterface/dllmain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/Hosts/HostsModuleInterface/dllmain.cpp b/src/modules/Hosts/HostsModuleInterface/dllmain.cpp index 807c0829c3..993226ac2b 100644 --- a/src/modules/Hosts/HostsModuleInterface/dllmain.cpp +++ b/src/modules/Hosts/HostsModuleInterface/dllmain.cpp @@ -216,6 +216,12 @@ public: m_hShowAdminEvent = nullptr; } + if (m_hTerminateEvent) + { + CloseHandle(m_hTerminateEvent); + m_hTerminateEvent = nullptr; + } + delete this; } @@ -280,6 +286,7 @@ public: SetEvent(m_hTerminateEvent); WaitForSingleObject(m_hProcess, 1500); TerminateProcess(m_hProcess, 1); + ResetEvent(m_hTerminateEvent); } m_enabled = false;