From a07f29cf4f7432e14c0e8df39fd6bf6802f596fd Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 31 Oct 2026 23:02:16 +0800 Subject: [PATCH] Stop the MCP stdio bridge leaving a quit OrcaSlicer as a zombie process --- src/slic3r/GUI/Mcp/McpStdioBridge.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/slic3r/GUI/Mcp/McpStdioBridge.cpp b/src/slic3r/GUI/Mcp/McpStdioBridge.cpp index da74d1ceb7..aeeb170353 100644 --- a/src/slic3r/GUI/Mcp/McpStdioBridge.cpp +++ b/src/slic3r/GUI/Mcp/McpStdioBridge.cpp @@ -260,6 +260,9 @@ bool launch_app(const std::string& exe, const std::string& datadir) return false; std::this_thread::sleep_for(std::chrono::milliseconds(100)); } + // The app stays this process's child, so reap it whenever it exits: an app quit while the bridge + // still runs would otherwise stay a zombie until the bridge exits. + std::thread([pid] { waitpid(pid, nullptr, 0); }).detach(); return true; #endif }