Cgi kill on destruct

This commit is contained in:
whaffman 2025-11-11 19:05:24 +01:00
parent bec2f37670
commit 443e5c3c3b
2 changed files with 8 additions and 3 deletions

View File

@ -29,6 +29,11 @@ CgiProcess::CgiProcess(const HttpRequest &request, CgiHandler &handler)
spawn();
}
CgiProcess::~CgiProcess()
{
this->kill();
}
void CgiProcess::spawn()
{
const URI &uri = request_.getUri();

View File

@ -16,7 +16,7 @@ class CgiProcess
CgiProcess &operator=(const CgiProcess &other) = delete;
CgiProcess &operator=(CgiProcess &&other) noexcept = delete;
~CgiProcess() = default;
~CgiProcess();
void kill() const noexcept;
void wait() noexcept;