]> granicus.if.org Git - icinga2/commitdiff
Don't seal DynamicObject updates.
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 19 Jun 2013 08:37:50 +0000 (10:37 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 19 Jun 2013 08:37:50 +0000 (10:37 +0200)
lib/base/array.cpp
lib/base/dictionary.cpp
lib/base/dynamicobject.cpp

index cfcd7c82674474e6d5b2ac845b5365dc7f0e84bd..575c10c2ec1fbb0e77ebb6a6c866fde8d7ebb8e1 100644 (file)
@@ -210,8 +210,6 @@ Array::Ptr Array::FromJson(cJSON *json)
                array->Add(Value::FromJson(i));
        }
 
-       array->Seal();
-
        return array;
 }
 
index c63110ab1ad468b0d8babc4d9e75af5cf659a298..d5914a596ef2228220db554106ac6430e59dcdff 100644 (file)
@@ -277,8 +277,6 @@ Dictionary::Ptr Dictionary::FromJson(cJSON *json)
                dictionary->Set(i->string, Value::FromJson(i));
        }
 
-       dictionary->Seal();
-
        return dictionary;
 }
 
index 055d38ea876dcf6c49c4cb9c91a2feb3857713ee..ed38d13223fdce6705226e38bec346fcd4b1b3a6 100644 (file)
@@ -113,8 +113,6 @@ Dictionary::Ptr DynamicObject::BuildUpdate(double sinceTx, int attributeTypes) c
                }
        }
 
-       attrs->Seal();
-
        Dictionary::Ptr update = boost::make_shared<Dictionary>();
        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");