From 3ac4f74feda6a7d2c2b51d66c7612977d14d971f Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 2 Dec 2016 09:10:37 +0100 Subject: [PATCH 1/1] plug an obvious memleak, bummer --- include/simgrid/s4u/engine.hpp | 3 +++ src/s4u/s4u_engine.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/simgrid/s4u/engine.hpp b/include/simgrid/s4u/engine.hpp index 395ea59060..07c471c996 100644 --- a/include/simgrid/s4u/engine.hpp +++ b/include/simgrid/s4u/engine.hpp @@ -27,6 +27,9 @@ namespace s4u { * This class is an interface to the simulation engine. */ XBT_PUBLIC_CLASS Engine { +private: + ~Engine(); + public: /** Constructor, taking the command line parameters of your main function */ Engine(int *argc, char **argv); diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index f28ecadc4d..da624f582d 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -35,6 +35,11 @@ Engine::Engine(int *argc, char **argv) { SIMIX_global_init(argc, argv); } +Engine::~Engine() +{ + delete pimpl; +} + Engine *Engine::instance() { if (s4u::Engine::instance_ == nullptr) new Engine(0,nullptr); -- 2.20.1