]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a potential memory leak.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Sep 1998 18:55:18 +0000 (18:55 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Sep 1998 18:55:18 +0000 (18:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@593 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/base.cc

index d9335a4bb9130fda0a0ce307709862c14990b454..a883c41abe7222a1d57943a902b4c442c732a77c 100644 (file)
@@ -48,8 +48,8 @@ void ProblemBase<dim>::set_tria_and_dof (Triangulation<dim> *t,
 
 template <int dim>
 void ProblemBase<dim>::clear () {
-  tria        = 0;
-  dof_handler = 0;
+  if (tria)        { delete tria;         tria        = 0; };
+  if (dof_handler) { delete dof_handler;  dof_handler = 0; };
   system_sparsity.reinit (0,0,1);
   system_matrix.clear ();
   right_hand_side.reinit (1);

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.