]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move an object to the stack. 9904/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 16 Apr 2020 01:38:40 +0000 (21:38 -0400)
committerDavid Wells <drwells@email.unc.edu>
Thu, 16 Apr 2020 02:04:23 +0000 (22:04 -0400)
source/grid/grid_out.cc

index f03760be66026dec3f452cbc7132a32a5190759f..47458eedf7e12f33caf04174fb55bcab12b5d44e 100644 (file)
@@ -4036,7 +4036,7 @@ namespace internal
 
       // If we need to plot curved lines then generate a quadrature formula to
       // place points via the mapping
-      Quadrature<dim> *           q_projector = nullptr;
+      Quadrature<dim>             q_projector;
       std::vector<Point<dim - 1>> boundary_points;
       if (mapping != nullptr)
         {
@@ -4049,8 +4049,7 @@ namespace internal
           std::vector<double> dummy_weights(n_points, 1. / n_points);
           Quadrature<dim - 1> quadrature(boundary_points, dummy_weights);
 
-          q_projector = new Quadrature<dim>(
-            QProjector<dim>::project_to_all_faces(quadrature));
+          q_projector = QProjector<dim>::project_to_all_faces(quadrature);
         }
 
       for (const auto &cell : tria.active_cell_iterators())
@@ -4100,7 +4099,7 @@ namespace internal
                       for (unsigned int i = 0; i < n_points; ++i)
                         line_points.push_back(
                           mapping->transform_unit_to_real_cell(
-                            cell, q_projector->point(offset + i)));
+                            cell, q_projector.point(offset + i)));
                       internal::remove_colinear_points(line_points);
 
                       for (const Point<spacedim> &point : line_points)
@@ -4127,9 +4126,6 @@ namespace internal
             }
         }
 
-      if (q_projector != nullptr)
-        delete q_projector;
-
       // make sure everything now gets to disk
       out.flush();
 

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.