RedisWriter#InsertObjectDependencies(): don't change config objects' attributes in-place

refs #52
This commit is contained in:
Alexander A. Klimov 2019-08-08 18:03:17 +02:00 committed by Michael Friedrich
parent d5d3f3e60c
commit e60ca9bca9
1 changed files with 2 additions and 0 deletions

View File

@ -586,6 +586,7 @@ void RedisWriter::InsertObjectDependencies(const ConfigObject::Ptr& object, cons
Dictionary::Ptr values;
if (kv.second.IsObjectType<Dictionary>()) {
values = kv.second;
values = values->ShallowClone();
} else if (kv.second.IsObjectType<Array>()) {
values = new Dictionary({{"value", JsonEncode(kv.second)}});
} else {
@ -619,6 +620,7 @@ void RedisWriter::InsertObjectDependencies(const ConfigObject::Ptr& object, cons
Dictionary::Ptr values;
if (kv.second.IsObjectType<Dictionary>()) {
values = kv.second;
values = values->ShallowClone();
} else if (kv.second.IsObjectType<Array>()) {
values = new Dictionary({{"value", JsonEncode(kv.second)}});
} else {