From e3c1de5f03a08c67e2efd3e18efb0b7d37694d8f Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 28 Jan 2020 10:36:19 +0100 Subject: [PATCH] fix helpers --- Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index d0f3ee94d06..ae091b60be3 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -42,25 +42,25 @@ namespace internal_tbb //classic pointer{ //normal template -void set_weighted_circumcenter(T t, T value) +void set_weighted_circumcenter(T* &t, T* value) { t = value; } //overload for nullptr template -void set_weighted_circumcenter(T t, std::nullptr_t) +void set_weighted_circumcenter(T* &t, std::nullptr_t) { t = nullptr; } template -bool compare_weighted_circumcenter(T t) +bool compare_weighted_circumcenter(T* t) { return t == nullptr; } template -void delete_circumcenter(T t ) +void delete_circumcenter(T* &t ) { delete t; } @@ -302,7 +302,7 @@ public: public: void invalidate_weighted_circumcenter_cache() const { - if (weighted_circumcenter_) { + if (!internal_tbb::compare_weighted_circumcenter(weighted_circumcenter_)) { internal_tbb::delete_circumcenter(weighted_circumcenter_); internal_tbb::set_weighted_circumcenter(weighted_circumcenter_, nullptr); } @@ -388,6 +388,7 @@ public: { if(!internal_tbb::compare_weighted_circumcenter(weighted_circumcenter_)){ internal_tbb::delete_circumcenter(weighted_circumcenter_); + internal_tbb::set_weighted_circumcenter(weighted_circumcenter_, nullptr); } }