diff --git a/src/admesh/connect.cpp b/src/admesh/connect.cpp index 5afb85d2c0..e729c89229 100644 --- a/src/admesh/connect.cpp +++ b/src/admesh/connect.cpp @@ -130,18 +130,12 @@ struct HashTableEdges { this->heads[i] = this->tail; } ~HashTableEdges() { - for (int i = 0; i < this->M; ++ i) { - for (HashEdge *temp = this->heads[i]; this->heads[i] != this->tail; temp = this->heads[i]) { - this->heads[i] = this->heads[i]->next; - pool.destroy(temp); #ifndef NDEBUG + for (int i = 0; i < this->M; ++ i) + for (HashEdge *temp = this->heads[i]; this->heads[i] != this->tail; temp = this->heads[i]) ++ this->freed; -#endif /* NDEBUG */ - } - } - this->heads.clear(); - pool.destroy(this->tail); this->tail = nullptr; +#endif /* NDEBUG */ } void insert_edge_exact(stl_file *stl, const HashEdge &edge) @@ -197,7 +191,7 @@ private: match_neighbors(edge, *link); // Delete the matched edge from the list. this->heads[chain_number] = link->next; - pool.destroy(link); + // pool.destroy(link); #ifndef NDEBUG ++ this->freed; #endif /* NDEBUG */ @@ -224,7 +218,7 @@ private: // Delete the matched edge from the list. HashEdge *temp = link->next; link->next = link->next->next; - pool.destroy(temp); + // pool.destroy(temp); #ifndef NDEBUG ++ this->freed; #endif /* NDEBUG */ diff --git a/src/admesh/normals.cpp b/src/admesh/normals.cpp index 4d47573f6c..16bb3daab5 100644 --- a/src/admesh/normals.cpp +++ b/src/admesh/normals.cpp @@ -25,6 +25,8 @@ #include #include +// Boost pool: Don't use mutexes to synchronize memory allocation. +#define BOOST_POOL_NO_MT #include #include "stl.h" @@ -192,7 +194,7 @@ void stl_fix_normal_directions(stl_file *stl) } stl_normal *temp = head->next; // Delete this facet from the list. head->next = head->next->next; - pool.destroy(temp); + // pool.destroy(temp); } else { // If we ran out of facets to fix: All of the facets in this part have been fixed. ++ stl->stats.number_of_parts; if (checked >= stl->stats.number_of_facets) @@ -214,8 +216,8 @@ void stl_fix_normal_directions(stl_file *stl) } } - pool.destroy(head); - pool.destroy(tail); + // pool.destroy(head); + // pool.destroy(tail); } void stl_fix_normal_values(stl_file *stl)