]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Catch throwing function in destructor 4034/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 5 Mar 2017 15:50:36 +0000 (16:50 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 6 Mar 2017 22:12:52 +0000 (23:12 +0100)
include/deal.II/lac/block_matrix_base.h
include/deal.II/lac/vector_memory.h
source/base/timer.cc
source/lac/block_sparsity_pattern.cc
source/lac/petsc_precondition.cc
source/lac/petsc_vector_base.cc
source/lac/trilinos_block_sparse_matrix.cc
source/numerics/time_dependent.cc

index e1647c2e5818b0c4932158d05128b61ec6e36f3f..179a8e0071f75a8c4c31a3ee53110a33fc03b0ea 100644 (file)
@@ -1495,7 +1495,12 @@ template <typename MatrixType>
 inline
 BlockMatrixBase<MatrixType>::~BlockMatrixBase ()
 {
-  clear ();
+  try
+    {
+      clear ();
+    }
+  catch (...)
+    {}
 }
 
 
index 72fd8edf1605490763549fc9e5a1d0d9fdd98b6e..0c3278f608e70e78f4bc2d37790c69a40cf961ca 100644 (file)
@@ -368,7 +368,12 @@ template <typename VectorType>
 inline
 VectorMemory<VectorType>::Pointer::~Pointer()
 {
-  pool->free(v);
+  try
+    {
+      pool->free(v);
+    }
+  catch (...)
+    {}
 }
 
 
index eea4331a26fb9363c4f02863857470380f6e94ee..6530c3662ac93c3bf1310459040f034d3fb50ade 100644 (file)
@@ -353,8 +353,13 @@ TimerOutput::TimerOutput (MPI_Comm      mpi_communicator,
 
 TimerOutput::~TimerOutput()
 {
-  while (active_sections.size() > 0)
-    leave_subsection();
+  try
+    {
+      while (active_sections.size() > 0)
+        leave_subsection();
+    }
+  catch (...)
+    {}
 
   if ( (output_frequency == summary || output_frequency == every_call_and_summary)
        && output_is_enabled == true)
index d1f30cc1dbaae761d5c86ff7c17911b31bc0edb1..5660af3c6b56f3a402d288fde5ad8b1710ac67a4 100644 (file)
@@ -64,7 +64,12 @@ template <class SparsityPatternBase>
 BlockSparsityPatternBase<SparsityPatternBase>::~BlockSparsityPatternBase ()
 {
   // clear all memory
-  reinit (0,0);
+  try
+    {
+      reinit (0,0);
+    }
+  catch (...)
+    {}
 }
 
 
index 5711041fa8cc2b1155eccb10602e4768b3752393..6f38dc05fe96ba903cf8c04e8082c406c2fad1e8 100644 (file)
@@ -37,7 +37,12 @@ namespace PETScWrappers
 
   PreconditionerBase::~PreconditionerBase ()
   {
-    clear();
+    try
+      {
+        clear();
+      }
+    catch (...)
+      {}
   }
 
   void
index 392c5dd282a8bffbe275fe4eafd5250a6a0db36a..178e0fe4f9ba7f755182d1dca68b996dcac5bc05 100644 (file)
@@ -206,7 +206,8 @@ namespace PETScWrappers
 #else
         const PetscErrorCode ierr = VecDestroy (&vector);
 #endif
-        AssertThrow (ierr == 0, ExcPETScError(ierr));
+        AssertNothrow (ierr == 0, ExcPETScError(ierr));
+        (void) ierr;
       }
   }
 
index 1b6d80151c64cf82ea525873998515bad1ae141a..d8544acd2129b1640312f8cb42c5354dd141e5a2 100644 (file)
@@ -33,7 +33,12 @@ namespace TrilinosWrappers
   {
     // delete previous content of
     // the subobjects array
-    clear ();
+    try
+      {
+        clear ();
+      }
+    catch (...)
+      {}
   }
 
 
index c54537a7322870c6583b3dfba2fbdb29de3f599a..7ebda7256b97fc04a3608d97cceb44b0445a7100 100644 (file)
@@ -51,8 +51,13 @@ TimeDependent::TimeDependent (const TimeSteppingData &data_primal,
 
 TimeDependent::~TimeDependent ()
 {
-  while (timesteps.size() != 0)
-    delete_timestep (0);
+  try
+    {
+      while (timesteps.size() != 0)
+        delete_timestep (0);
+    }
+  catch (...)
+    {}
 }
 
 

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.