mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-13 00:21:49 +08:00
fix ei_aligned_delete for null pointers and non trivial dtors
This commit is contained in:
parent
19a70ae939
commit
90d6fc0e28
@ -315,6 +315,7 @@ template<typename T> inline T* ei_construct_elements_of_array(T *ptr, size_t siz
|
|||||||
template<typename T> inline void ei_destruct_elements_of_array(T *ptr, size_t size)
|
template<typename T> inline void ei_destruct_elements_of_array(T *ptr, size_t size)
|
||||||
{
|
{
|
||||||
// always destruct an array starting from the end.
|
// always destruct an array starting from the end.
|
||||||
|
if(ptr)
|
||||||
while(size) ptr[--size].~T();
|
while(size) ptr[--size].~T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user