aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-07-14 22:49:34 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-07-14 22:49:34 +0200
commit90d6fc0e28d8f955b0b6efdd6ee9b62facd357c6 (patch)
tree1bba5a34d91cab157e3967fdac02380c716b64d6
parent19a70ae939911505839358d8e3ba72c51e47b254 (diff)
fix ei_aligned_delete for null pointers and non trivial dtors
-rw-r--r--Eigen/src/Core/util/Memory.h3
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();
}
/*****************************************************************************