]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a problem with the order in which dof and tria were deleted.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Dec 1998 15:46:24 +0000 (15:46 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Dec 1998 15:46:24 +0000 (15:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@686 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/Attic/examples/convergence/convergence.cc
tests/big-tests/convergence/convergence.cc

index 4c53da2b0c2784bd6bb2fb6628e47145729e9cbf..80aa35ae60a9ab68ddb432cbf91e8d65f1e63cbb 100644 (file)
@@ -202,15 +202,16 @@ PoissonProblem<dim>::PoissonProblem (unsigned int order) :
 
 template <int dim>
 void PoissonProblem<dim>::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<dim>::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;
 };
 
 
index 4c53da2b0c2784bd6bb2fb6628e47145729e9cbf..80aa35ae60a9ab68ddb432cbf91e8d65f1e63cbb 100644 (file)
@@ -202,15 +202,16 @@ PoissonProblem<dim>::PoissonProblem (unsigned int order) :
 
 template <int dim>
 void PoissonProblem<dim>::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<dim>::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;
 };
 
 

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.