From a6ec23fb24bee3a5f7d8e3eb71f0e928be7d12c8 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Thu, 22 Aug 2024 11:06:36 +0200 Subject: [PATCH] main add prefix to simulators --- tools/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/main.cpp b/tools/main.cpp index b907420..e1fb76c 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -6,15 +6,16 @@ #include "simulators.hpp" #include "websocket.hpp" -Simulators simulators; +Simulators g_simulators; Websocket* g_web_socket; void int_handler(int s) { UNUSED(s); std::cout << "\nCaught Ctrl + C\nShutting down." << std::endl; - g_web_socket->stop(); - simulators.stop(); + if (g_web_socket != nullptr) + g_web_socket->stop(); + g_simulators.stop(); // delay std::this_thread::sleep_for(std::chrono::milliseconds(1000)); exit(1);