[PPL-devel] [GIT] ppl/ppl(pip): Fixed memory leak.

François Galea francois.galea at uvsq.fr
Thu Oct 8 07:28:26 CEST 2009


Module: ppl/ppl
Branch: pip
Commit: 0f6fb91d81ebec0f5ed260643bb9c8821f80b341
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=0f6fb91d81ebec0f5ed260643bb9c8821f80b341

Author: François Galea <francois.galea at uvsq.fr>
Date:   Wed Oct  7 20:33:36 2009 +0200

Fixed memory leak.

---

 src/PIP_Problem.cc         |    6 ++++++
 src/PIP_Problem.inlines.hh |    4 ----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/PIP_Problem.cc b/src/PIP_Problem.cc
index 225372f..7042940 100644
--- a/src/PIP_Problem.cc
+++ b/src/PIP_Problem.cc
@@ -60,6 +60,12 @@ PPL::PIP_Problem::PIP_Problem(const PIP_Problem &y)
     parameters(y.parameters),
     initial_context(y.initial_context) {
   PPL_ASSERT(OK());
+  //FIXME: must also copy the solution tree
+}
+
+PPL::PIP_Problem::~PIP_Problem() {
+  if (current_solution != 0)
+    delete current_solution;
 }
 
 PPL::PIP_Problem_Status
diff --git a/src/PIP_Problem.inlines.hh b/src/PIP_Problem.inlines.hh
index ae6b5c2..44cbc94 100644
--- a/src/PIP_Problem.inlines.hh
+++ b/src/PIP_Problem.inlines.hh
@@ -25,10 +25,6 @@ site: http://www.cs.unipr.it/ppl/ . */
 
 namespace Parma_Polyhedra_Library {
 
-inline
-PIP_Problem::~PIP_Problem() {
-}
-
 inline dimension_type
 PIP_Problem::space_dimension() const {
   return external_space_dim;




More information about the PPL-devel mailing list