mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +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.
|
||||
const IfcUtil::IfcBaseClass* next() {
|
||||
using std::chrono::high_resolution_clock;
|
||||
|
||||
delete *task_result_iterator_;
|
||||
delete *native_task_result_iterator_;
|
||||
|
||||
if (num_threads_ != 1) {
|
||||
if (!wait_for_element()) {
|
||||
Logger::SetProduct(boost::none);
|
||||
@@ -885,19 +889,16 @@ namespace IfcGeom {
|
||||
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) {
|
||||
delete k;
|
||||
}
|
||||
|
||||
for (auto& p : all_processed_elements_) {
|
||||
delete p;
|
||||
|
||||
if (task_result_ptr_initialized) {
|
||||
while (task_result_iterator_ != --all_processed_elements_.end()) {
|
||||
delete *task_result_iterator_++;
|
||||
delete *native_task_result_iterator_++;
|
||||
}
|
||||
}
|
||||
|
||||
delete converter_;
|
||||
|
||||
Reference in New Issue
Block a user