mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-23 05:14:26 +08:00
fix aligned_delete for null pointers
This commit is contained in:
parent
c44bbabdcc
commit
c7b8de77c0
@ -188,7 +188,8 @@ 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)
|
template<typename T> inline void ei_destruct_elements_of_array(T *ptr, std::size_t size)
|
||||||
{
|
{
|
||||||
// always destruct an array starting from the end.
|
// always destruct an array starting from the end.
|
||||||
while(size) ptr[--size].~T();
|
if(ptr)
|
||||||
|
while(size) ptr[--size].~T();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \internal delete objects constructed with ei_aligned_new
|
/** \internal delete objects constructed with ei_aligned_new
|
||||||
|
Loading…
x
Reference in New Issue
Block a user