diff options
| author | 2025-08-20 23:04:42 +0800 | |
|---|---|---|
| committer | 2025-12-05 00:43:45 +0100 | |
| commit | b020cf26b8f35aa82a091e02945325af4b2534b0 (patch) | |
| tree | fa8d6c9f11dbb2099ef2f6df71d7583272869e3e /src/Array.cpp | |
| parent | 18e5b22a71f85091127cc063db79c8df687c582c (diff) | |
| download | libplist-b020cf26b8f35aa82a091e02945325af4b2534b0.tar.gz libplist-b020cf26b8f35aa82a091e02945325af4b2534b0.tar.bz2 | |
cpp: Add `this` comparison to `operator=` copy assign
Diffstat (limited to 'src/Array.cpp')
| -rw-r--r-- | src/Array.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Array.cpp b/src/Array.cpp index 49b8924..784df7c 100644 --- a/src/Array.cpp +++ b/src/Array.cpp @@ -62,6 +62,8 @@ Array::Array(const PList::Array& a) : Structure(a.GetParent()) Array& Array::operator=(const PList::Array& a) { + if (this == &a) return *this; + plist_free(_node); for (size_t it = 0; it < _array.size(); it++) { delete _array.at(it); |
