]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Patch by Alexander Grayver: Release memort in SparseDirectMUMPS.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Dec 2012 12:21:11 +0000 (12:21 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 12 Dec 2012 12:21:11 +0000 (12:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@27793 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_solver.h
deal.II/source/lac/petsc_solver.cc

index 598bc31db5a47acff22c6d8f420b1e02b06baade..ae38d634f0ac83cc9c0853e226a5936c0c607447 100644 (file)
@@ -1241,10 +1241,15 @@ namespace PETScWrappers
      * function in the base is not used
      * here, the private SolverData struct
      * located in the base could not be used
-     * either
+     * either.
      */
     struct SolverDataMUMPS
     {
+      /**
+       * Destructor
+       */
+      ~SolverDataMUMPS ();
+
       KSP ksp;
       PC  pc;
     };
index cdd889e8365da98b75f2985e95b6ea63a762de3a..caaa9ea4b94d0ae054739af016ac612673f44be0 100644 (file)
@@ -594,6 +594,19 @@ namespace PETScWrappers
 
   /* ---------------------- SparseDirectMUMPS------------------------ */
 
+  SparseDirectMUMPS::SolverDataMUMPS::~SolverDataMUMPS ()
+  {
+    // destroy the solver object
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
+    int ierr = KSPDestroy (ksp);
+#else
+    int ierr = KSPDestroy (&ksp);
+#endif
+
+    AssertThrow (ierr == 0, ExcPETScError(ierr));
+  }
+
+
   SparseDirectMUMPS::SparseDirectMUMPS (SolverControl     &cn,
                                         const MPI_Comm       &mpi_communicator,
                                         const AdditionalData &data)

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.