mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
#2704 retain kernel pool to free cache
This commit is contained in:
@@ -132,8 +132,12 @@ namespace IfcGeom {
|
||||
MAKE_TYPE_NAME(IteratorImplementation_)(const MAKE_TYPE_NAME(IteratorImplementation_)&); // N/I
|
||||
MAKE_TYPE_NAME(IteratorImplementation_)& operator=(const MAKE_TYPE_NAME(IteratorImplementation_)&); // N/I
|
||||
|
||||
// When single-threaded
|
||||
MAKE_TYPE_NAME(Kernel) kernel;
|
||||
|
||||
// When multi-threaded
|
||||
std::vector<MAKE_TYPE_NAME(Kernel)*> kernel_pool;
|
||||
|
||||
IteratorSettings settings;
|
||||
IfcParse::IfcFile* ifc_file;
|
||||
std::vector<filter_t> filters_;
|
||||
@@ -312,7 +316,6 @@ namespace IfcGeom {
|
||||
conc_threads = tasks_.size();
|
||||
}
|
||||
|
||||
std::vector<MAKE_TYPE_NAME(Kernel)*> kernel_pool;
|
||||
kernel_pool.reserve(conc_threads);
|
||||
for (unsigned i = 0; i < conc_threads; ++i) {
|
||||
kernel_pool.push_back(new MAKE_TYPE_NAME(Kernel)(kernel));
|
||||
@@ -1219,6 +1222,10 @@ namespace IfcGeom {
|
||||
delete p;
|
||||
}
|
||||
|
||||
for (auto& k : kernel_pool) {
|
||||
delete k;
|
||||
}
|
||||
|
||||
free_shapes();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user