diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Array.cpp | 2 | ||||
| -rw-r--r-- | src/Boolean.cpp | 2 | ||||
| -rw-r--r-- | src/Data.cpp | 2 | ||||
| -rw-r--r-- | src/Date.cpp | 2 | ||||
| -rw-r--r-- | src/Dictionary.cpp | 2 | ||||
| -rw-r--r-- | src/Integer.cpp | 2 | ||||
| -rw-r--r-- | src/Key.cpp | 2 | ||||
| -rw-r--r-- | src/Real.cpp | 2 | ||||
| -rw-r--r-- | src/String.cpp | 2 | ||||
| -rw-r--r-- | src/Uid.cpp | 2 |
10 files changed, 20 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()) | |||
| 62 | 62 | ||
| 63 | Array& Array::operator=(const PList::Array& a) | 63 | Array& Array::operator=(const PList::Array& a) |
| 64 | { | 64 | { |
| 65 | if (this == &a) return *this; | ||
| 66 | |||
| 65 | plist_free(_node); | 67 | plist_free(_node); |
| 66 | for (size_t it = 0; it < _array.size(); it++) { | 68 | for (size_t it = 0; it < _array.size(); it++) { |
| 67 | delete _array.at(it); | 69 | delete _array.at(it); |
diff --git a/src/Boolean.cpp b/src/Boolean.cpp index 9ec1a63..2a5e303 100644 --- a/src/Boolean.cpp +++ b/src/Boolean.cpp | |||
| @@ -40,6 +40,8 @@ Boolean::Boolean(const PList::Boolean& b) : Node(PLIST_BOOLEAN) | |||
| 40 | 40 | ||
| 41 | Boolean& Boolean::operator=(const PList::Boolean& b) | 41 | Boolean& Boolean::operator=(const PList::Boolean& b) |
| 42 | { | 42 | { |
| 43 | if (this == &b) return *this; | ||
| 44 | |||
| 43 | plist_free(_node); | 45 | plist_free(_node); |
| 44 | _node = plist_copy(b.GetPlist()); | 46 | _node = plist_copy(b.GetPlist()); |
| 45 | return *this; | 47 | return *this; |
diff --git a/src/Data.cpp b/src/Data.cpp index 56b2d6b..94767c9 100644 --- a/src/Data.cpp +++ b/src/Data.cpp | |||
| @@ -40,6 +40,8 @@ Data::Data(const PList::Data& d) : Node(PLIST_DATA) | |||
| 40 | 40 | ||
| 41 | Data& Data::operator=(const PList::Data& b) | 41 | Data& Data::operator=(const PList::Data& b) |
| 42 | { | 42 | { |
| 43 | if (this == &b) return *this; | ||
| 44 | |||
| 43 | plist_free(_node); | 45 | plist_free(_node); |
| 44 | _node = plist_copy(b.GetPlist()); | 46 | _node = plist_copy(b.GetPlist()); |
| 45 | return *this; | 47 | return *this; |
diff --git a/src/Date.cpp b/src/Date.cpp index cbfa123..214220b 100644 --- a/src/Date.cpp +++ b/src/Date.cpp | |||
| @@ -40,6 +40,8 @@ Date::Date(const PList::Date& d) : Node(PLIST_DATE) | |||
| 40 | 40 | ||
| 41 | Date& Date::operator=(const PList::Date& d) | 41 | Date& Date::operator=(const PList::Date& d) |
| 42 | { | 42 | { |
| 43 | if (this == &d) return *this; | ||
| 44 | |||
| 43 | plist_free(_node); | 45 | plist_free(_node); |
| 44 | _node = plist_copy(d.GetPlist()); | 46 | _node = plist_copy(d.GetPlist()); |
| 45 | return *this; | 47 | return *this; |
diff --git a/src/Dictionary.cpp b/src/Dictionary.cpp index 0a909e5..b354945 100644 --- a/src/Dictionary.cpp +++ b/src/Dictionary.cpp | |||
| @@ -65,6 +65,8 @@ Dictionary::Dictionary(const PList::Dictionary& d) : Structure(d.GetParent()) | |||
| 65 | 65 | ||
| 66 | Dictionary& Dictionary::operator=(const PList::Dictionary& d) | 66 | Dictionary& Dictionary::operator=(const PList::Dictionary& d) |
| 67 | { | 67 | { |
| 68 | if (this == &d) return *this; | ||
| 69 | |||
| 68 | for (Dictionary::iterator it = _map.begin(); it != _map.end(); it++) | 70 | for (Dictionary::iterator it = _map.begin(); it != _map.end(); it++) |
| 69 | { | 71 | { |
| 70 | plist_free(it->second->GetPlist()); | 72 | plist_free(it->second->GetPlist()); |
diff --git a/src/Integer.cpp b/src/Integer.cpp index 653455d..26e7ccf 100644 --- a/src/Integer.cpp +++ b/src/Integer.cpp | |||
| @@ -41,6 +41,8 @@ Integer::Integer(const PList::Integer& i) : Node(PLIST_INT) | |||
| 41 | 41 | ||
| 42 | Integer& Integer::operator=(const PList::Integer& i) | 42 | Integer& Integer::operator=(const PList::Integer& i) |
| 43 | { | 43 | { |
| 44 | if (this == &i) return *this; | ||
| 45 | |||
| 44 | plist_free(_node); | 46 | plist_free(_node); |
| 45 | _node = plist_copy(i.GetPlist()); | 47 | _node = plist_copy(i.GetPlist()); |
| 46 | return *this; | 48 | return *this; |
diff --git a/src/Key.cpp b/src/Key.cpp index 86a0bf8..459227a 100644 --- a/src/Key.cpp +++ b/src/Key.cpp | |||
| @@ -40,6 +40,8 @@ Key::Key(const PList::Key& k) : Node(PLIST_INT) | |||
| 40 | 40 | ||
| 41 | Key& Key::operator=(const PList::Key& k) | 41 | Key& Key::operator=(const PList::Key& k) |
| 42 | { | 42 | { |
| 43 | if (this == &k) return *this; | ||
| 44 | |||
| 43 | plist_free(_node); | 45 | plist_free(_node); |
| 44 | _node = plist_copy(k.GetPlist()); | 46 | _node = plist_copy(k.GetPlist()); |
| 45 | return *this; | 47 | return *this; |
diff --git a/src/Real.cpp b/src/Real.cpp index 02d1d9b..b743ab5 100644 --- a/src/Real.cpp +++ b/src/Real.cpp | |||
| @@ -39,6 +39,8 @@ Real::Real(const PList::Real& d) : Node(PLIST_INT) | |||
| 39 | 39 | ||
| 40 | Real& Real::operator=(const PList::Real& d) | 40 | Real& Real::operator=(const PList::Real& d) |
| 41 | { | 41 | { |
| 42 | if (this == &d) return *this; | ||
| 43 | |||
| 42 | plist_free(_node); | 44 | plist_free(_node); |
| 43 | _node = plist_copy(d.GetPlist()); | 45 | _node = plist_copy(d.GetPlist()); |
| 44 | return *this; | 46 | return *this; |
diff --git a/src/String.cpp b/src/String.cpp index 8daec0f..bcd5e2e 100644 --- a/src/String.cpp +++ b/src/String.cpp | |||
| @@ -40,6 +40,8 @@ String::String(const PList::String& s) : Node(PLIST_INT) | |||
| 40 | 40 | ||
| 41 | String& String::operator=(const PList::String& s) | 41 | String& String::operator=(const PList::String& s) |
| 42 | { | 42 | { |
| 43 | if (this == &s) return *this; | ||
| 44 | |||
| 43 | plist_free(_node); | 45 | plist_free(_node); |
| 44 | _node = plist_copy(s.GetPlist()); | 46 | _node = plist_copy(s.GetPlist()); |
| 45 | return *this; | 47 | return *this; |
diff --git a/src/Uid.cpp b/src/Uid.cpp index 8c73c80..d73f777 100644 --- a/src/Uid.cpp +++ b/src/Uid.cpp | |||
| @@ -40,6 +40,8 @@ Uid::Uid(const PList::Uid& i) : Node(PLIST_UID) | |||
| 40 | 40 | ||
| 41 | Uid& Uid::operator=(const PList::Uid& i) | 41 | Uid& Uid::operator=(const PList::Uid& i) |
| 42 | { | 42 | { |
| 43 | if (this == &i) return *this; | ||
| 44 | |||
| 43 | plist_free(_node); | 45 | plist_free(_node); |
| 44 | _node = plist_copy(i.GetPlist()); | 46 | _node = plist_copy(i.GetPlist()); |
| 45 | return *this; | 47 | return *this; |
