From 06ebd006bef2e658f0b5637b3609a21914df2bf8 Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 15 Apr 2020 21:38:40 -0400 Subject: [PATCH] Move an object to the stack. --- source/grid/grid_out.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index f03760be66..47458eedf7 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -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 * q_projector = nullptr; + Quadrature q_projector; std::vector> boundary_points; if (mapping != nullptr) { @@ -4049,8 +4049,7 @@ namespace internal std::vector dummy_weights(n_points, 1. / n_points); Quadrature quadrature(boundary_points, dummy_weights); - q_projector = new Quadrature( - QProjector::project_to_all_faces(quadrature)); + q_projector = QProjector::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 &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(); -- 2.39.5