From ba95065ce37cc43ae8b0e9932be52cc7f45f93be Mon Sep 17 00:00:00 2001 From: TimQu <tim.quatmann@rwth-aachen.de> Date: Wed, 19 Aug 2015 21:04:53 +0200 Subject: [PATCH] Fixed memory leak by adding destructors for linear equation solvers. Previously, the member unique_ptr<...> gmmxxMatrix from the gmmxx subclasses was not deleted properly Former-commit-id: c21911b56a4f161e7a00582585265ee9e2e8d25f --- src/solver/LinearEquationSolver.h | 5 +++++ src/solver/MinMaxLinearEquationSolver.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/solver/LinearEquationSolver.h b/src/solver/LinearEquationSolver.h index 43b3f9ad5..61f26294e 100644 --- a/src/solver/LinearEquationSolver.h +++ b/src/solver/LinearEquationSolver.h @@ -15,6 +15,11 @@ namespace storm { template<class Type> class LinearEquationSolver { public: + + virtual ~LinearEquationSolver() { + // Intentionally left empty. + } + /*! * Solves the equation system A*x = b. The matrix A is required to be square and have a unique solution. * The solution of the set of linear equations will be written to the vector x. Note that the matrix A has diff --git a/src/solver/MinMaxLinearEquationSolver.h b/src/solver/MinMaxLinearEquationSolver.h index 2c31f67cb..e9679a6b4 100644 --- a/src/solver/MinMaxLinearEquationSolver.h +++ b/src/solver/MinMaxLinearEquationSolver.h @@ -19,6 +19,11 @@ namespace storm { template<class ValueType> class MinMaxLinearEquationSolver { public: + + virtual ~MinMaxLinearEquationSolver() { + // Intentionally left empty. + } + /*! * Solves the equation system x = min/max(A*x + b) given by the parameters. Note that the matrix A has * to be given upon construction time of the solver object.