fix aligned_delete for null pointers

This commit is contained in:
Gael Guennebaud 2010-07-15 09:28:29 +02:00
parent c44bbabdcc
commit c7b8de77c0

View File

@ -188,6 +188,7 @@ template<> inline void ei_conditional_aligned_free<false>(void *ptr)
template<typename T> inline void ei_destruct_elements_of_array(T *ptr, std::size_t size)
{
// always destruct an array starting from the end.
if(ptr)
while(size) ptr[--size].~T();
}