From fdf60044c3042c1de94f6b4b854fed2830d79b37 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sun, 22 Sep 2019 23:29:13 +0200 Subject: [PATCH] fix agg::pod_array and pod_vector move constructors These were added with #4031, and probably not used in the end, as Mapnik compiles and all tests pass without them. However, they might be useful, so I'm only removing bad calls to deallocate with uninitialized values, and doing proper member initialization. --- deps/agg/include/agg_array.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/deps/agg/include/agg_array.h b/deps/agg/include/agg_array.h index 47bb2da53..19af752aa 100644 --- a/deps/agg/include/agg_array.h +++ b/deps/agg/include/agg_array.h @@ -124,11 +124,10 @@ namespace agg memcpy(m_array, v.m_array, sizeof(T) * m_size); } - pod_array(self_type && rhs) + pod_array(self_type && rhs) : + m_array(rhs.m_array), + m_size(rhs.m_size) { - pod_allocator::deallocate(m_array, m_size); - m_array = rhs.m_array; - m_size = rhs.m_size; rhs.m_array = nullptr; rhs.m_size = 0; } @@ -284,12 +283,11 @@ namespace agg } //------------------------------------------------------------------------ - template pod_vector::pod_vector(pod_vector && rhs) + template pod_vector::pod_vector(pod_vector && rhs) : + m_size(rhs.m_size), + m_capacity(rhs.m_capacity), + m_array(rhs.m_array) { - pod_allocator::deallocate(m_array, m_capacity); - m_size = rhs.m_size; - m_capacity = rhs.m_capacity; - m_array = rhs.m_array; rhs.m_size = 0; rhs.m_capacity = 0; rhs.m_array = nullptr;