From a6b046a460db573ee6e9ab7f1529a1e97d1d3f2e Mon Sep 17 00:00:00 2001 From: 3lswear Date: Wed, 23 Feb 2022 22:49:33 +0300 Subject: [PATCH] fix: exit on SIGINT to avoid leaks --- src/Server/Server.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Server/Server.cpp b/src/Server/Server.cpp index b98c0f8..585d9da 100644 --- a/src/Server/Server.cpp +++ b/src/Server/Server.cpp @@ -231,7 +231,11 @@ bool Server::TimeToDie(struct timeval &last_modif, int lifeTime) void sigHandler(int sig) { if (sig == SIGINT) - throw ConfigException("SIGINT called. Server shutdown!"); + { + std::cerr << "\n"; + std::cerr << getDebugTime() << FAIL << "SIGINT called. Server shutdown!" << std::endl; + exit(-1); + } } void Server::run(void)