From 648f25e9cc6938a0321dab72cb6fce228877ae98 Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Sun, 1 Jan 2023 14:20:52 -0600 Subject: [PATCH] fix terminating server process --- ErsatzTV-Windows/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ErsatzTV-Windows/src/main.rs b/ErsatzTV-Windows/src/main.rs index 0297b2f71..3d425e662 100644 --- a/ErsatzTV-Windows/src/main.rs +++ b/ErsatzTV-Windows/src/main.rs @@ -94,7 +94,10 @@ fn main() { None => {} Some(mut child) => { unsafe { - Console::GenerateConsoleCtrlEvent(Console::CTRL_C_EVENT, 0); + if Console::AttachConsole(child.id()) == true + { + Console::GenerateConsoleCtrlEvent(Console::CTRL_C_EVENT, 0); + } } child.wait().unwrap(); }