From 3b6a071ac7016ed41eae26f7fea967bbbdbaefd6 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 10 Feb 2000 13:58:38 +0000 Subject: [PATCH] Add a destructor, to avoid a memory leak. git-svn-id: https://svn.dealii.org/trunk@2366 0785d39b-7218-0410-832d-ea1e28bc413d --- .../Attic/examples/error-estimation/error-estimation.cc | 8 ++++++++ tests/big-tests/error-estimation/error-estimation.cc | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc index 80648997e3..cd11fc8630 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc +++ b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc @@ -82,6 +82,7 @@ class PoissonProblem : public ProblemBase, public MultipleParameterLoop::Us }; PoissonProblem (); + ~PoissonProblem (); void clear (); void create_new (const unsigned int); @@ -337,6 +338,13 @@ PoissonProblem::PoissonProblem () : +template +PoissonProblem::~PoissonProblem () +{ + clear (); +}; + + template void PoissonProblem::clear () { diff --git a/tests/big-tests/error-estimation/error-estimation.cc b/tests/big-tests/error-estimation/error-estimation.cc index 80648997e3..cd11fc8630 100644 --- a/tests/big-tests/error-estimation/error-estimation.cc +++ b/tests/big-tests/error-estimation/error-estimation.cc @@ -82,6 +82,7 @@ class PoissonProblem : public ProblemBase, public MultipleParameterLoop::Us }; PoissonProblem (); + ~PoissonProblem (); void clear (); void create_new (const unsigned int); @@ -337,6 +338,13 @@ PoissonProblem::PoissonProblem () : +template +PoissonProblem::~PoissonProblem () +{ + clear (); +}; + + template void PoissonProblem::clear () { -- 2.39.5