From: Wolfgang Bangerth Date: Wed, 9 Sep 1998 18:55:18 +0000 (+0000) Subject: Fix a potential memory leak. X-Git-Tag: v8.0.0~22664 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7192e8c18b0818f15755d10d2680789a0673c6c5;p=dealii.git Fix a potential memory leak. git-svn-id: https://svn.dealii.org/trunk@593 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/base.cc b/deal.II/deal.II/source/numerics/base.cc index d9335a4bb9..a883c41abe 100644 --- a/deal.II/deal.II/source/numerics/base.cc +++ b/deal.II/deal.II/source/numerics/base.cc @@ -48,8 +48,8 @@ void ProblemBase::set_tria_and_dof (Triangulation *t, template void ProblemBase::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);