From da85de4795c72139ef643df00c6702ab151f512f Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Fri, 12 Jul 2019 08:52:50 +0200 Subject: [PATCH] Fix ArrayMem::operator=(ArrayMem&&) (again) --- libsrc/core/array.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libsrc/core/array.hpp b/libsrc/core/array.hpp index 211a5c04..253a476c 100644 --- a/libsrc/core/array.hpp +++ b/libsrc/core/array.hpp @@ -1115,11 +1115,15 @@ namespace ngcore ngcore::Swap (mem_to_delete, a2.mem_to_delete); ngcore::Swap (allocsize, a2.allocsize); ngcore::Swap (size, a2.size); - ngcore::Swap (data, a2.data); if (mem_to_delete==nullptr) + { for (auto i : Range(size)) mem[i] = std::move(a2.mem[i]); + data = mem; + } + else + ngcore::Swap (data, a2.data); return *this; }