From: bangerth Date: Wed, 20 Aug 2008 12:54:24 +0000 (+0000) Subject: Use a shared_ptr and thereby also remove the memory leak that we currently have. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc46dd6603c54862d394b9fcdacef83fc466c0c1;p=dealii-svn.git 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 --- 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);