From e17aa88cad2c37039e93958599a84ed9107f4c97 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 15 Jul 2020 16:21:51 +0200 Subject: [PATCH] set signal handlers only if NG_BACKTRACE is set --- libsrc/core/exception.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libsrc/core/exception.cpp b/libsrc/core/exception.cpp index df750050..b89d721e 100644 --- a/libsrc/core/exception.cpp +++ b/libsrc/core/exception.cpp @@ -217,9 +217,12 @@ static void ngcore_signal_handler(int sig) // register signal handler when library is loaded static bool dummy = []() { - signal(SIGABRT, ngcore_signal_handler); - signal(SIGILL, ngcore_signal_handler); - signal(SIGSEGV, ngcore_signal_handler); + if(getenv("NG_BACKTRACE")) + { + signal(SIGABRT, ngcore_signal_handler); + signal(SIGILL, ngcore_signal_handler); + signal(SIGSEGV, ngcore_signal_handler); + } return true; }();