diff options
author | David Robillard <d@drobilla.net> | 2020-07-18 10:34:58 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-07-18 10:37:57 +0200 |
commit | cb1b1c5710d207376eee7bb4b9c894c80dd072b3 (patch) | |
tree | 3de21e4b3fcfe0f9cc586257271b7eda55ec3ae8 /raul | |
parent | ffd68a419f6f3530f9bbf98cbe9ff0b2c95c983e (diff) | |
download | raul-cb1b1c5710d207376eee7bb4b9c894c80dd072b3.tar.gz raul-cb1b1c5710d207376eee7bb4b9c894c80dd072b3.tar.bz2 raul-cb1b1c5710d207376eee7bb4b9c894c80dd072b3.zip |
Fix Array self-assignment
Diffstat (limited to 'raul')
-rw-r--r-- | raul/Array.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<T>& operator=(const Array<T>& array) { + if (&array == this) { + return *this; + } + _size = array._size; _elems = _size ? new T[_size] : nullptr; |