diff options
Diffstat (limited to 'common/almalloc.h')
-rw-r--r-- | common/almalloc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/almalloc.h b/common/almalloc.h index 15ec600d..ed6756f3 100644 --- a/common/almalloc.h +++ b/common/almalloc.h @@ -265,8 +265,8 @@ DIAGNOSTIC_POP } FlexArray(index_type size) : mSize{size} - { uninitialized_default_construct_n(mArray, mSize); } - ~FlexArray() { destroy_n(mArray, mSize); } + { if(mSize > 0) uninitialized_default_construct_n(std::addressof(mArray[0]), mSize); } + ~FlexArray() { if(mSize > 0) destroy_n(std::addressof(mArray[0]), mSize); } FlexArray(const FlexArray&) = delete; FlexArray& operator=(const FlexArray&) = delete; |