diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-07-14 22:49:34 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-07-14 22:49:34 +0200 |
commit | 90d6fc0e28d8f955b0b6efdd6ee9b62facd357c6 (patch) | |
tree | 1bba5a34d91cab157e3967fdac02380c716b64d6 | |
parent | 19a70ae939911505839358d8e3ba72c51e47b254 (diff) |
fix ei_aligned_delete for null pointers and non trivial dtors
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 1b89525a8..75c3e5ec4 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -315,7 +315,8 @@ 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) { // always destruct an array starting from the end. - while(size) ptr[--size].~T(); + if(ptr) + while(size) ptr[--size].~T(); } /***************************************************************************** |