From 3c69735dde8a00fe4dcd2bbeb54d2eca03b434d0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 15 Apr 2014 17:58:51 +0200 Subject: [PATCH] Fix the deletion of p_rng_ --- Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 798b16a3ac9..8dc825163b3 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -657,13 +657,16 @@ public: void set_random_generator(CGAL::Random* p_rng) { + if(delete_rng_) delete p_rng_; if(!p_rng_) { p_rng_ = new CGAL::Random(0); delete_rng_ = true; } - else + else { p_rng_ = p_rng; + delete_rng_ = false; + } } private: