From bc46dd6603c54862d394b9fcdacef83fc466c0c1 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 20 Aug 2008 12:54:24 +0000 Subject: [PATCH] Use a shared_ptr and thereby also remove the memory leak that we currently have. git-svn-id: https://svn.dealii.org/trunk@16607 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-31/step-31.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deal.II/examples/step-31/step-31.cc b/deal.II/examples/step-31/step-31.cc index 712d6d7b8b..9e332ae3bd 100644 --- a/deal.II/examples/step-31/step-31.cc +++ b/deal.II/examples/step-31/step-31.cc @@ -126,7 +126,7 @@ class PreconditionerTrilinosAmg : public Subscriptor private: - ML_Epetra::MultiLevelPreconditioner* ml_precond; + boost::shared_ptr ml_precond; Epetra_SerialComm communicator; std::auto_ptr Map; @@ -257,7 +257,8 @@ void PreconditionerTrilinosAmg::initialize ( MLList.set("null space: vectors", (double *)&null_space[0]); } - ml_precond = new ML_Epetra::MultiLevelPreconditioner(*Matrix, MLList, true); + ml_precond = boost::shared_ptr + (new ML_Epetra::MultiLevelPreconditioner(*Matrix, MLList, true)); if (output_details) ml_precond->PrintUnused(0); -- 2.39.5