]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use a shared_ptr and thereby also remove the memory leak that we currently have.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Aug 2008 12:54:24 +0000 (12:54 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Aug 2008 12:54:24 +0000 (12:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@16607 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-31/step-31.cc

index 712d6d7b8b2d359cb00495f3e3018aed21a9771a..9e332ae3bdc4272bb91594e2189ee66391075bac 100644 (file)
@@ -126,7 +126,7 @@ class PreconditionerTrilinosAmg : public Subscriptor
 
   private:
     
-    ML_Epetra::MultiLevelPreconditioner* ml_precond;
+    boost::shared_ptr<ML_Epetra::MultiLevelPreconditioner> ml_precond;
     
     Epetra_SerialComm  communicator;
     std::auto_ptr<Epetra_Map>       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<ML_Epetra::MultiLevelPreconditioner>
+              (new ML_Epetra::MultiLevelPreconditioner(*Matrix, MLList, true));
 
   if (output_details)
     ml_precond->PrintUnused(0);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.