diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-10-23 02:33:47 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-10-23 02:33:47 +0300 |
commit | fe7088c99ff084f7218ab20136d49eb1a1dccd0b (patch) | |
tree | 3b3df4270110bbffa4a738e379dce5319fec9653 /source/blender/blenkernel/intern/attribute_access.cc | |
parent | b5a69061e7d464914662ae0dd6fed46a999a56bb (diff) | |
parent | b70bbfadfecec049ad1ac2de7a949198ca6c15bc (diff) |
Merge remote-tracking branch 'origin' into temp-sculpt-brush-channel
Diffstat (limited to 'source/blender/blenkernel/intern/attribute_access.cc')
-rw-r--r-- | source/blender/blenkernel/intern/attribute_access.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index b86353bdb74..544427cfdd3 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -642,15 +642,26 @@ CustomDataAttributes::CustomDataAttributes(CustomDataAttributes &&other) size_ = other.size_; data = other.data; CustomData_reset(&other.data); + other.size_ = 0; } CustomDataAttributes &CustomDataAttributes::operator=(const CustomDataAttributes &other) { - if (this != &other) { - CustomData_copy(&other.data, &data, CD_MASK_ALL, CD_DUPLICATE, other.size_); - size_ = other.size_; + if (this == &other) { + return *this; } + this->~CustomDataAttributes(); + new (this) CustomDataAttributes(other); + return *this; +} +CustomDataAttributes &CustomDataAttributes::operator=(CustomDataAttributes &&other) +{ + if (this == &other) { + return *this; + } + this->~CustomDataAttributes(); + new (this) CustomDataAttributes(std::move(other)); return *this; } |