From 0d64a8fd32303a7f166e6f167a8d3695db003936 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 19 Jun 2013 10:37:50 +0200 Subject: [PATCH] Don't seal DynamicObject updates. --- lib/base/array.cpp | 2 -- lib/base/dictionary.cpp | 2 -- lib/base/dynamicobject.cpp | 12 ------------ 3 files changed, 16 deletions(-) diff --git a/lib/base/array.cpp b/lib/base/array.cpp index cfcd7c826..575c10c2e 100644 --- a/lib/base/array.cpp +++ b/lib/base/array.cpp @@ -210,8 +210,6 @@ Array::Ptr Array::FromJson(cJSON *json) array->Add(Value::FromJson(i)); } - array->Seal(); - return array; } diff --git a/lib/base/dictionary.cpp b/lib/base/dictionary.cpp index c63110ab1..d5914a596 100644 --- a/lib/base/dictionary.cpp +++ b/lib/base/dictionary.cpp @@ -277,8 +277,6 @@ Dictionary::Ptr Dictionary::FromJson(cJSON *json) dictionary->Set(i->string, Value::FromJson(i)); } - dictionary->Seal(); - return dictionary; } diff --git a/lib/base/dynamicobject.cpp b/lib/base/dynamicobject.cpp index 055d38ea8..ed38d1322 100644 --- a/lib/base/dynamicobject.cpp +++ b/lib/base/dynamicobject.cpp @@ -113,8 +113,6 @@ Dictionary::Ptr DynamicObject::BuildUpdate(double sinceTx, int attributeTypes) c } } - attrs->Seal(); - Dictionary::Ptr update = boost::make_shared(); update->Set("attrs", attrs); @@ -123,8 +121,6 @@ Dictionary::Ptr DynamicObject::BuildUpdate(double sinceTx, int attributeTypes) c else if (attrs->GetLength() == 0) return Dictionary::Ptr(); - update->Seal(); - return update; } @@ -133,8 +129,6 @@ void DynamicObject::ApplyUpdate(const Dictionary::Ptr& serializedUpdate, { ObjectLock olock(this); - ASSERT(serializedUpdate->IsSealed()); - Value configTxValue = serializedUpdate->Get("configTx"); boost::mutex::scoped_lock lock(m_AttributeMutex); @@ -155,8 +149,6 @@ void DynamicObject::ApplyUpdate(const Dictionary::Ptr& serializedUpdate, Dictionary::Ptr attrs = serializedUpdate->Get("attrs"); - ASSERT(attrs->IsSealed()); - { ObjectLock alock(attrs); @@ -167,8 +159,6 @@ void DynamicObject::ApplyUpdate(const Dictionary::Ptr& serializedUpdate, Dictionary::Ptr attr = it->second; - ASSERT(attr->IsSealed()); - int type = attr->Get("type"); if ((type & ~allowedTypes) != 0) @@ -519,8 +509,6 @@ void DynamicObject::RestoreObjects(const String& filename) while (NetString::ReadStringFromStream(sfp, &message)) { Dictionary::Ptr persistentObject = Value::Deserialize(message); - ASSERT(persistentObject->IsSealed()); - String type = persistentObject->Get("type"); String name = persistentObject->Get("name"); Dictionary::Ptr update = persistentObject->Get("update");