From: wolf Date: Wed, 9 Dec 1998 15:46:24 +0000 (+0000) Subject: Fix a problem with the order in which dof and tria were deleted. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eccb4e3785f44d652b36c12803dddaa9044b6605;p=dealii-svn.git Fix a problem with the order in which dof and tria were deleted. git-svn-id: https://svn.dealii.org/trunk@686 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Attic/examples/convergence/convergence.cc b/deal.II/deal.II/Attic/examples/convergence/convergence.cc index 4c53da2b0c..80aa35ae60 100644 --- a/deal.II/deal.II/Attic/examples/convergence/convergence.cc +++ b/deal.II/deal.II/Attic/examples/convergence/convergence.cc @@ -202,15 +202,16 @@ PoissonProblem::PoissonProblem (unsigned int order) : template void PoissonProblem::clear () { + if (dof != 0) { + delete dof; + dof = 0; + }; + if (tria != 0) { delete tria; tria = 0; }; - if (dof != 0) { - delete dof; - dof = 0; - }; // make it known to the underlying // ProblemBase that tria and dof @@ -422,11 +423,16 @@ int PoissonProblem::run (const unsigned int level) { cout << endl; + const unsigned int n_dofs = dof->n_dofs(); + // release the lock that the dof object + // has to the finite element object + dof->clear (); + delete fe; delete quadrature; delete boundary_quadrature; - return dof->n_dofs(); + return n_dofs; }; diff --git a/tests/big-tests/convergence/convergence.cc b/tests/big-tests/convergence/convergence.cc index 4c53da2b0c..80aa35ae60 100644 --- a/tests/big-tests/convergence/convergence.cc +++ b/tests/big-tests/convergence/convergence.cc @@ -202,15 +202,16 @@ PoissonProblem::PoissonProblem (unsigned int order) : template void PoissonProblem::clear () { + if (dof != 0) { + delete dof; + dof = 0; + }; + if (tria != 0) { delete tria; tria = 0; }; - if (dof != 0) { - delete dof; - dof = 0; - }; // make it known to the underlying // ProblemBase that tria and dof @@ -422,11 +423,16 @@ int PoissonProblem::run (const unsigned int level) { cout << endl; + const unsigned int n_dofs = dof->n_dofs(); + // release the lock that the dof object + // has to the finite element object + dof->clear (); + delete fe; delete quadrature; delete boundary_quadrature; - return dof->n_dofs(); + return n_dofs; };