From: Martin Quinson Date: Thu, 29 Jun 2017 20:56:31 +0000 (+0200) Subject: make it possible to destroy the engine X-Git-Tag: v3_17~501 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7b2dae6b07e092ffb183a0a4cbad2b419f20a081?ds=sidebyside;hp=063ee2aabef6b7ae8f82c39ad7c00f6d2c74f2d5 make it possible to destroy the engine --- 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()