From cb1b1c5710d207376eee7bb4b9c894c80dd072b3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 18 Jul 2020 10:34:58 +0200 Subject: Fix Array self-assignment --- raul/Array.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/raul/Array.hpp b/raul/Array.hpp index 5ba57a5..cac993d 100644 --- a/raul/Array.hpp +++ b/raul/Array.hpp @@ -67,6 +67,10 @@ public: Array& operator=(const Array& array) { + if (&array == this) { + return *this; + } + _size = array._size; _elems = _size ? new T[_size] : nullptr; -- cgit v1.2.1