From 7b2dae6b07e092ffb183a0a4cbad2b419f20a081 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 29 Jun 2017 22:56:31 +0200 Subject: [PATCH] make it possible to destroy the engine --- include/simgrid/s4u/Engine.hpp | 4 +--- src/s4u/s4u_engine.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index 9aab4fe0fa..94dc8d1ec1 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -28,13 +28,11 @@ namespace s4u { */ XBT_PUBLIC_CLASS Engine { -private: - ~Engine(); - public: /** Constructor, taking the command line parameters of your main function */ Engine(int* argc, char** argv); + ~Engine(); /** Finalize the default engine and all its dependencies */ static void shutdown(); diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index 9ab100720c..64bb8826d4 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -42,6 +42,7 @@ Engine::Engine(int *argc, char **argv) { Engine::~Engine() { delete pimpl; + s4u::Engine::instance_ = nullptr; } Engine *Engine::instance() { @@ -52,7 +53,6 @@ Engine *Engine::instance() { void Engine::shutdown() { delete s4u::Engine::instance_; - s4u::Engine::instance_ = nullptr; } double Engine::getClock() -- 2.20.1