EgtGeomKernel :

- correzioni alle HashGrids per evitare problemi con memoria
- ottimizzazione calcolo CollisionAvoid con TestSeries e TestPath fatti di seguito
- piccole milgiorie a Pocketing.
This commit is contained in:
Dario Sassi
2024-07-12 08:46:00 +02:00
parent fd4677d099
commit aade1d19f1
5 changed files with 68 additions and 68 deletions
+11 -11
View File
@@ -116,7 +116,7 @@ HashGrid1d::~HashGrid1d( void)
{
Clear() ;
for ( Cell* pCell = m_cell ; pCell < m_cell + m_CellCount ; ++ pCell) {
for ( Cell* pCell = m_cell ; pCell != nullptr && pCell < m_cell + m_CellCount ; ++ pCell) {
if ( pCell->m_neighborOffset != m_stdNeighborOffset)
delete[] pCell->m_neighborOffset ;
}
@@ -396,8 +396,10 @@ HashGrid1d::Enlarge( void)
for ( auto pCell = m_cell ; pCell < m_cell + m_CellCount ; ++ pCell) {
if ( pCell->m_neighborOffset != m_stdNeighborOffset)
delete[] pCell->m_neighborOffset ;
pCell->m_neighborOffset = nullptr ;
}
delete[] m_cell ;
m_cell = nullptr ;
// ... the number of cells is doubled in each coordinate direction, ...
m_CellCount *= 2 ;
@@ -641,17 +643,15 @@ HashGrids1d::Find( const BBox3d& b3Test, INTVECTOR& vnIds) const
void
HashGrids1d::Clear( void)
{
for ( auto pGrid : m_GridList) {
delete pGrid ;
}
m_GridList.clear() ;
m_bGridActive = false ;
m_nonGridObjs.clear() ;
m_ObjsList.clear() ;
m_ObjsMap.clear() ;
m_objsToAdd.clear() ;
m_nonGridObjs.clear() ;
for ( auto pGrid : m_GridList)
delete pGrid ;
m_GridList.clear() ;
m_bActivate = true ;
m_bGridActive = false ;
m_b3Objs.Reset() ;
}