From 2df1c67a5245dda393b2291a1a3fea77affb82d7 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Sat, 24 Aug 2024 19:07:35 +0200 Subject: [PATCH] b main sig int handler check if pointer is not null --- tools/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/main.cpp b/tools/main.cpp index bc6c76d..7224497 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -41,7 +41,8 @@ void int_handler(int s) g_out << "Caught Ctrl + C" << std::endl; if (g_web_socket != nullptr) g_web_socket->stop(); - g_simulators->stop(); + if (g_simulators != nullptr) + g_simulators->stop(); g_out << "Shutting down." << std::endl; // delay to allow the server to stop gracefully std::this_thread::sleep_for(std::chrono::milliseconds(1000));