Skip to content

[JSON::Object] After copy-ctor, JSON::Object::_keys still points to keys in map of copied object #1355

@mazhen2009

Description

@mazhen2009
JSON::Array jsnArry;
for (size_t k = 0; k < 10; k++)
{
    JSON::Object subObjValue(true);
    subObjValue.set("Value", "value1");
    subObjValue.set("Frequency", "Frequency1");
    jsnArry.add(subObjValue);
}

jsnArry.add(subObjValue) will copy subObjValue, and the _keys was copied. but the _keys is &ret.first->first. It was not updated to the new pointer.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions