From: David Wells Date: Thu, 16 Apr 2020 01:38:40 +0000 (-0400) Subject: Move an object to the stack. X-Git-Tag: v9.2.0-rc1~222^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9904%2Fhead;p=dealii.git Move an object to the stack. --- 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();