mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Issue 6385 - Delete IfcGeom::Elements as soon as possible (#6411)
* ISSUE #6385 Delete iterator elements as soon as they are moved past * ISSUE #6385 added loop to destructor to clean up initialised elements not yet disposed of by the iterator
This commit is contained in:
+10
-9
@@ -663,6 +663,10 @@ namespace IfcGeom {
|
|||||||
/// Use get() to retrieve the created geometry.
|
/// Use get() to retrieve the created geometry.
|
||||||
const IfcUtil::IfcBaseClass* next() {
|
const IfcUtil::IfcBaseClass* next() {
|
||||||
using std::chrono::high_resolution_clock;
|
using std::chrono::high_resolution_clock;
|
||||||
|
|
||||||
|
delete *task_result_iterator_;
|
||||||
|
delete *native_task_result_iterator_;
|
||||||
|
|
||||||
if (num_threads_ != 1) {
|
if (num_threads_ != 1) {
|
||||||
if (!wait_for_element()) {
|
if (!wait_for_element()) {
|
||||||
Logger::SetProduct(boost::none);
|
Logger::SetProduct(boost::none);
|
||||||
@@ -885,19 +889,16 @@ namespace IfcGeom {
|
|||||||
init_future_.wait();
|
init_future_.wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings_.get<ifcopenshell::geometry::settings::IteratorOutput>().get() != ifcopenshell::geometry::settings::NATIVE) {
|
|
||||||
for (auto& p : all_processed_native_elements_) {
|
|
||||||
delete p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& k : kernel_pool) {
|
for (auto& k : kernel_pool) {
|
||||||
delete k;
|
delete k;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& p : all_processed_elements_) {
|
if (task_result_ptr_initialized) {
|
||||||
delete p;
|
while (task_result_iterator_ != --all_processed_elements_.end()) {
|
||||||
|
delete *task_result_iterator_++;
|
||||||
|
delete *native_task_result_iterator_++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete converter_;
|
delete converter_;
|
||||||
|
|||||||
Reference in New Issue
Block a user