summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h11
2 files changed, 7 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6bea06e2..047079bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@ if(MSVC)
# Turn off some VC++ warnings
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018")
else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -Wsign-compare")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -Wno-sign-compare")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
endif()
@@ -76,7 +76,7 @@ else()
add_subdirectory(src/Bottleneck/test)
# GudhUI
- add_subdirectory(src/GudhUI)
+ #add_subdirectory(src/GudhUI)
# data points generator
add_subdirectory(data/points/generator)
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
index 05f70c39..efe20151 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
@@ -266,13 +266,10 @@ class Persistent_cohomology {
}
~Persistent_cohomology() {
-// Clean the remaining columns in the matrix.
- for (auto & cam_ref : cam_) {
- cam_ref.col_.clear();
- }
-// Clean the transversal lists
+ // Clean the transversal lists
for (auto & transverse_ref : transverse_idx_) {
- transverse_ref.second.row_->clear();
+ // Release all the cells
+ transverse_ref.second.row_->clear_and_dispose([&](Cell*p){cell_pool_.destroy(p);});
delete transverse_ref.second.row_;
}
}
@@ -600,6 +597,8 @@ class Persistent_cohomology {
Simplex_key key_tmp = dsets_.find_set(curr_col->class_key_);
ds_repr_[key_tmp] = &(*(result_insert_cam.first));
result_insert_cam.first->class_key_ = key_tmp;
+ // intrusive containers don't own their elements, we have to release them manually
+ curr_col->col_.clear_and_dispose([&](Cell*p){cell_pool_.destroy(p);});
column_pool_.destroy(curr_col); // delete curr_col;
}
}