From 754fbf6785d4929e45b3ce277e9c5cfd8e44b8c0 Mon Sep 17 00:00:00 2001 From: Navv Date: Fri, 19 Jan 2018 16:35:01 +0200 Subject: [PATCH] Remove profileset options after processing --- engine/sim/sc_profileset.cpp | 8 ++++++++ engine/sim/sc_profileset.hpp | 2 ++ 2 files changed, 10 insertions(+) diff --git a/engine/sim/sc_profileset.cpp b/engine/sim/sc_profileset.cpp index c1c22c7092d..ee2908ced50 100644 --- a/engine/sim/sc_profileset.cpp +++ b/engine/sim/sc_profileset.cpp @@ -148,6 +148,12 @@ sim_control_t* profile_set_t::options() const return m_options; } +void profile_set_t::cleanup_options() +{ + delete m_options; + m_options = nullptr; +} + profile_set_t::~profile_set_t() { delete m_options; @@ -443,6 +449,8 @@ bool profilesets_t::iterate( sim_t* parent ) } ); } + set -> cleanup_options(); + delete profile_sim; } diff --git a/engine/sim/sc_profileset.hpp b/engine/sim/sc_profileset.hpp index 2c065c68db1..fbc4bfe6e1c 100644 --- a/engine/sim/sc_profileset.hpp +++ b/engine/sim/sc_profileset.hpp @@ -239,6 +239,8 @@ class profile_set_t ~profile_set_t(); + void cleanup_options(); + const std::string& name() const { return m_name; }