From fde6962ab8aa4d03a74a5208facdf81bb7e0b581 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 16 Nov 1998 16:53:16 +0000 Subject: [PATCH] Delete objects in the right order. git-svn-id: https://svn.dealii.org/trunk@669 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/Attic/examples/dof/dof_test.cc | 2 +- .../examples/error-estimation/error-estimation.cc | 2 +- .../deal.II/Attic/examples/multigrid/multigrid.cc | 12 ++++++------ deal.II/deal.II/Attic/examples/poisson/Makefile | 2 +- deal.II/deal.II/Attic/examples/poisson/equation.cc | 2 ++ deal.II/deal.II/Attic/examples/poisson/problem.cc | 13 +++++++------ tests/big-tests/dof/dof_test.cc | 2 +- .../big-tests/error-estimation/error-estimation.cc | 2 +- tests/big-tests/multigrid/multigrid.cc | 12 ++++++------ tests/big-tests/poisson/Makefile | 2 +- tests/big-tests/poisson/equation.cc | 2 ++ tests/big-tests/poisson/problem.cc | 13 +++++++------ 12 files changed, 36 insertions(+), 30 deletions(-) diff --git a/deal.II/deal.II/Attic/examples/dof/dof_test.cc b/deal.II/deal.II/Attic/examples/dof/dof_test.cc index 15b5395016..c4fc5358ab 100644 --- a/deal.II/deal.II/Attic/examples/dof/dof_test.cc +++ b/deal.II/deal.II/Attic/examples/dof/dof_test.cc @@ -99,8 +99,8 @@ TestCases::TestCases () : template void TestCases::create_new (const unsigned int) { - if (tria != 0) delete tria; if (dof != 0) delete dof; + if (tria != 0) delete tria; tria = new Triangulation(); tria->create_hypercube(); diff --git a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc index c83757d28a..ab3c7b4933 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc +++ b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc @@ -306,8 +306,8 @@ PoissonProblem::PoissonProblem () : template void PoissonProblem::clear () { - if (tria != 0) { delete tria; tria = 0; }; if (dof != 0) { delete dof; dof = 0; }; + if (tria != 0) { delete tria; tria = 0; }; if (rhs != 0) { delete rhs; rhs = 0; }; if (solution_function != 0) { delete solution_function; solution_function = 0; }; if (coefficient != 0) { delete coefficient; coefficient = 0; }; diff --git a/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc b/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc index 657f3c61fa..a6451bfd1d 100644 --- a/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc +++ b/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc @@ -271,17 +271,17 @@ PoissonProblem::PoissonProblem (unsigned int order) : template -void PoissonProblem::clear () { - if (tria != 0) { - delete tria; - tria = 0; - }; - +void PoissonProblem::clear () { if (dof != 0) { delete dof; dof = 0; }; + if (tria != 0) { + delete tria; + tria = 0; + }; + if (rhs != 0) { delete rhs; diff --git a/deal.II/deal.II/Attic/examples/poisson/Makefile b/deal.II/deal.II/Attic/examples/poisson/Makefile index ba6405c2a2..fe1e05124b 100644 --- a/deal.II/deal.II/Attic/examples/poisson/Makefile +++ b/deal.II/deal.II/Attic/examples/poisson/Makefile @@ -11,7 +11,7 @@ target = poisson # the archives ./Obj.a and ./Obj.g.a. By default, the debug version # is used to link. It you don't like that, change the following # variable to "off" -debug-mode = off +debug-mode = on # If you want your program to be linked with extra object or library # files, specify them here: diff --git a/deal.II/deal.II/Attic/examples/poisson/equation.cc b/deal.II/deal.II/Attic/examples/poisson/equation.cc index e30bfefa76..915b92a52c 100644 --- a/deal.II/deal.II/Attic/examples/poisson/equation.cc +++ b/deal.II/deal.II/Attic/examples/poisson/equation.cc @@ -9,6 +9,7 @@ #if deal_II_dimension == 1 +template <> void PoissonEquation<1>::assemble (dFMatrix &cell_matrix, dVector &rhs, const FEValues<1> &fe_values, @@ -32,6 +33,7 @@ void PoissonEquation<1>::assemble (dFMatrix &cell_matrix, #if deal_II_dimension == 2 +template <> void PoissonEquation<2>::assemble (dFMatrix &cell_matrix, dVector &rhs, const FEValues<2> &fe_values, diff --git a/deal.II/deal.II/Attic/examples/poisson/problem.cc b/deal.II/deal.II/Attic/examples/poisson/problem.cc index 68096f524e..e24b5d1aff 100644 --- a/deal.II/deal.II/Attic/examples/poisson/problem.cc +++ b/deal.II/deal.II/Attic/examples/poisson/problem.cc @@ -163,17 +163,18 @@ PoissonProblem::PoissonProblem () : template -void PoissonProblem::clear () { - if (tria != 0) { - delete tria; - tria = 0; - }; - +void PoissonProblem::clear () { if (dof != 0) { delete dof; dof = 0; }; + if (tria != 0) { + delete tria; + tria = 0; + }; + + if (rhs != 0) { delete rhs; diff --git a/tests/big-tests/dof/dof_test.cc b/tests/big-tests/dof/dof_test.cc index 15b5395016..c4fc5358ab 100644 --- a/tests/big-tests/dof/dof_test.cc +++ b/tests/big-tests/dof/dof_test.cc @@ -99,8 +99,8 @@ TestCases::TestCases () : template void TestCases::create_new (const unsigned int) { - if (tria != 0) delete tria; if (dof != 0) delete dof; + if (tria != 0) delete tria; tria = new Triangulation(); tria->create_hypercube(); diff --git a/tests/big-tests/error-estimation/error-estimation.cc b/tests/big-tests/error-estimation/error-estimation.cc index c83757d28a..ab3c7b4933 100644 --- a/tests/big-tests/error-estimation/error-estimation.cc +++ b/tests/big-tests/error-estimation/error-estimation.cc @@ -306,8 +306,8 @@ PoissonProblem::PoissonProblem () : template void PoissonProblem::clear () { - if (tria != 0) { delete tria; tria = 0; }; if (dof != 0) { delete dof; dof = 0; }; + if (tria != 0) { delete tria; tria = 0; }; if (rhs != 0) { delete rhs; rhs = 0; }; if (solution_function != 0) { delete solution_function; solution_function = 0; }; if (coefficient != 0) { delete coefficient; coefficient = 0; }; diff --git a/tests/big-tests/multigrid/multigrid.cc b/tests/big-tests/multigrid/multigrid.cc index 657f3c61fa..a6451bfd1d 100644 --- a/tests/big-tests/multigrid/multigrid.cc +++ b/tests/big-tests/multigrid/multigrid.cc @@ -271,17 +271,17 @@ PoissonProblem::PoissonProblem (unsigned int order) : template -void PoissonProblem::clear () { - if (tria != 0) { - delete tria; - tria = 0; - }; - +void PoissonProblem::clear () { if (dof != 0) { delete dof; dof = 0; }; + if (tria != 0) { + delete tria; + tria = 0; + }; + if (rhs != 0) { delete rhs; diff --git a/tests/big-tests/poisson/Makefile b/tests/big-tests/poisson/Makefile index ba6405c2a2..fe1e05124b 100644 --- a/tests/big-tests/poisson/Makefile +++ b/tests/big-tests/poisson/Makefile @@ -11,7 +11,7 @@ target = poisson # the archives ./Obj.a and ./Obj.g.a. By default, the debug version # is used to link. It you don't like that, change the following # variable to "off" -debug-mode = off +debug-mode = on # If you want your program to be linked with extra object or library # files, specify them here: diff --git a/tests/big-tests/poisson/equation.cc b/tests/big-tests/poisson/equation.cc index e30bfefa76..915b92a52c 100644 --- a/tests/big-tests/poisson/equation.cc +++ b/tests/big-tests/poisson/equation.cc @@ -9,6 +9,7 @@ #if deal_II_dimension == 1 +template <> void PoissonEquation<1>::assemble (dFMatrix &cell_matrix, dVector &rhs, const FEValues<1> &fe_values, @@ -32,6 +33,7 @@ void PoissonEquation<1>::assemble (dFMatrix &cell_matrix, #if deal_II_dimension == 2 +template <> void PoissonEquation<2>::assemble (dFMatrix &cell_matrix, dVector &rhs, const FEValues<2> &fe_values, diff --git a/tests/big-tests/poisson/problem.cc b/tests/big-tests/poisson/problem.cc index 68096f524e..e24b5d1aff 100644 --- a/tests/big-tests/poisson/problem.cc +++ b/tests/big-tests/poisson/problem.cc @@ -163,17 +163,18 @@ PoissonProblem::PoissonProblem () : template -void PoissonProblem::clear () { - if (tria != 0) { - delete tria; - tria = 0; - }; - +void PoissonProblem::clear () { if (dof != 0) { delete dof; dof = 0; }; + if (tria != 0) { + delete tria; + tria = 0; + }; + + if (rhs != 0) { delete rhs; -- 2.39.5