File tree Expand file tree Collapse file tree 10 files changed +20
-0
lines changed
Expand file tree Collapse file tree 10 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ Array::Array(const PList::Array& a) : Structure(a.GetParent())
6262
6363Array& Array::operator =(const PList::Array& a)
6464{
65+ if (this == &a) return *this ;
66+
6567 plist_free (_node);
6668 for (size_t it = 0 ; it < _array.size (); it++) {
6769 delete _array.at (it);
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ Boolean::Boolean(const PList::Boolean& b) : Node(PLIST_BOOLEAN)
4040
4141Boolean& Boolean::operator =(const PList::Boolean& b)
4242{
43+ if (this == &b) return *this ;
44+
4345 plist_free (_node);
4446 _node = plist_copy (b.GetPlist ());
4547 return *this ;
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ Data::Data(const PList::Data& d) : Node(PLIST_DATA)
4040
4141Data& Data::operator =(const PList::Data& b)
4242{
43+ if (this == &b) return *this ;
44+
4345 plist_free (_node);
4446 _node = plist_copy (b.GetPlist ());
4547 return *this ;
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ Date::Date(const PList::Date& d) : Node(PLIST_DATE)
4040
4141Date& Date::operator =(const PList::Date& d)
4242{
43+ if (this == &d) return *this ;
44+
4345 plist_free (_node);
4446 _node = plist_copy (d.GetPlist ());
4547 return *this ;
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ Dictionary::Dictionary(const PList::Dictionary& d) : Structure(d.GetParent())
6565
6666Dictionary& Dictionary::operator =(const PList::Dictionary& d)
6767{
68+ if (this == &d) return *this ;
69+
6870 for (Dictionary::iterator it = _map.begin (); it != _map.end (); it++)
6971 {
7072 plist_free (it->second ->GetPlist ());
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ Integer::Integer(const PList::Integer& i) : Node(PLIST_INT)
4141
4242Integer& Integer::operator =(const PList::Integer& i)
4343{
44+ if (this == &i) return *this ;
45+
4446 plist_free (_node);
4547 _node = plist_copy (i.GetPlist ());
4648 return *this ;
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ Key::Key(const PList::Key& k) : Node(PLIST_INT)
4040
4141Key& Key::operator =(const PList::Key& k)
4242{
43+ if (this == &k) return *this ;
44+
4345 plist_free (_node);
4446 _node = plist_copy (k.GetPlist ());
4547 return *this ;
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ Real::Real(const PList::Real& d) : Node(PLIST_INT)
3939
4040Real& Real::operator =(const PList::Real& d)
4141{
42+ if (this == &d) return *this ;
43+
4244 plist_free (_node);
4345 _node = plist_copy (d.GetPlist ());
4446 return *this ;
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ String::String(const PList::String& s) : Node(PLIST_INT)
4040
4141String& String::operator =(const PList::String& s)
4242{
43+ if (this == &s) return *this ;
44+
4345 plist_free (_node);
4446 _node = plist_copy (s.GetPlist ());
4547 return *this ;
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ Uid::Uid(const PList::Uid& i) : Node(PLIST_UID)
4040
4141Uid& Uid::operator =(const PList::Uid& i)
4242{
43+ if (this == &i) return *this ;
44+
4345 plist_free (_node);
4446 _node = plist_copy (i.GetPlist ());
4547 return *this ;
You can’t perform that action at this time.
0 commit comments