From b260c95d3efbcbd5f6cd31e6e04f03df8a7aace1 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Fri, 22 Dec 2017 12:39:59 +0100 Subject: [PATCH] Fix memory leak --- Point_set_3/include/CGAL/Point_set_3/IO.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Point_set_3/include/CGAL/Point_set_3/IO.h b/Point_set_3/include/CGAL/Point_set_3/IO.h index e61fd15ec55..7b33dd85343 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO.h @@ -171,6 +171,12 @@ public: : m_point_set (point_set), m_use_floats (false) { } + ~Point_set_3_filler() + { + for (std::size_t i = 0; i < m_properties.size(); ++ i) + delete m_properties[i]; + } + void instantiate_properties (PLY_reader& reader) { const std::vector& readers @@ -556,6 +562,9 @@ write_ply_point_set( if (get_mode (stream) == IO::ASCII) stream << std::endl; } + + for (std::size_t i = 0; i < printers.size(); ++ i) + delete printers[i]; return true; }