From 01bc7d404337747b1decc12b86949c9cfd3d092e Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 23 Aug 2022 13:12:21 +0200 Subject: [PATCH] Application::Exit(): don't exit(), but _exit(), even in debug build mode Case: 1. icinga2 api setup 2. icinga2 daemon -C -x debug Before: Second commands crashes at exit. After: No crash. As the comment between the removed lines clearly says: Our destructors haven't been built for static data. This is build type independent. --- lib/base/application.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/base/application.cpp b/lib/base/application.cpp index dc032f4ea..048dee1c3 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -112,11 +112,7 @@ void Application::Exit(int rc) } UninitializeBase(); -#ifdef I2_DEBUG - exit(rc); -#else /* I2_DEBUG */ _exit(rc); // Yay, our static destructors are pretty much beyond repair at this point. -#endif /* I2_DEBUG */ } void Application::InitializeBase()