mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 00:07:59 +02:00
fixed GH #1355: [JSON::Object] After copy-ctor, JSON::Object::_keys still points to keys in map of copied object
This commit is contained in:
@@ -303,6 +303,19 @@ inline std::size_t Object::size() const
|
||||
inline void Object::remove(const std::string& key)
|
||||
{
|
||||
_values.erase(key);
|
||||
if (_preserveInsOrder)
|
||||
{
|
||||
KeyPtrList::iterator it = _keys.begin();
|
||||
KeyPtrList::iterator end = _keys.end();
|
||||
for (; it != end; ++it)
|
||||
{
|
||||
if (key == **it)
|
||||
{
|
||||
_keys.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user