Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make it possible to destroy the engine
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 29 Jun 2017 20:56:31 +0000 (22:56 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 29 Jun 2017 20:56:31 +0000 (22:56 +0200)
include/simgrid/s4u/Engine.hpp
src/s4u/s4u_engine.cpp

index 9aab4fe..94dc8d1 100644 (file)
@@ -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();
 
index 9ab1007..64bb882 100644 (file)
@@ -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()