diff --git a/Classification/examples/Classification/example_cluster_classification.cpp b/Classification/examples/Classification/example_cluster_classification.cpp index bd68016d589..ea11160b881 100644 --- a/Classification/examples/Classification/example_cluster_classification.cpp +++ b/Classification/examples/Classification/example_cluster_classification.cpp @@ -86,7 +86,12 @@ int main (int argc, char** argv) #endif generator.generate_point_based_features (pointwise_features); - generator.generate_normal_based_features (pointwise_features, pts.normal_map()); + + // Generator should only be used with variables defined at the scope + // of the generator object, thus we instantiate the normal map + // outside of the function + Vmap normal_map = pts.normal_map(); + generator.generate_normal_based_features (pointwise_features, normal_map); #ifdef CGAL_LINKED_WITH_TBB pointwise_features.end_parallel_additions(); @@ -156,8 +161,8 @@ int main (int argc, char** argv) // First, compute means of features. features.begin_parallel_additions(); - for (Feature_handle fh : pointwise_features) - features.add (clusters, fh); + for (std::size_t i = 0; i < pointwise_features.size(); ++ i) + features.add (clusters, pointwise_features[i]); features.end_parallel_additions(); // Then, compute variances of features (and remaining cluster features). diff --git a/Classification/include/CGAL/Classification/Feature_set.h b/Classification/include/CGAL/Classification/Feature_set.h index 5aebe0b266d..c5930ffb5ec 100644 --- a/Classification/include/CGAL/Classification/Feature_set.h +++ b/Classification/include/CGAL/Classification/Feature_set.h @@ -228,7 +228,7 @@ public: { #ifdef CGAL_LINKED_WITH_TBB m_tasks->wait(); - m_tasks.release(); + m_tasks.reset(); m_adders.clear(); #endif }