Skip to content

Commit 95bd539

Browse files
committed
Fixed memory leak when using FSA Memory allocator
- Use of placement new requires explict call to object destructor before releasing memory back into the memory pool. Otherwise, memory leaks will occur when a new object is allocated over the previous object occupying that memory space.
1 parent e11620c commit 95bd539

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎stlastar.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ template <class UserState> class AStarSearch
717717
#if !USE_FSA_MEMORY
718718
delete node;
719719
#else
720+
node->~Node();
720721
m_FixedSizeAllocator.free( node );
721722
#endif
722723
}

0 commit comments

Comments
 (0)