mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Fix incorrect locks
This commit is contained in:
parent
a5684ea2ac
commit
c10da708ff
@ -120,7 +120,9 @@ Expression::Ptr ConfigItem::GetExpressionList(void) const
|
|||||||
|
|
||||||
Dictionary::Ptr ConfigItem::GetProperties(void)
|
Dictionary::Ptr ConfigItem::GetProperties(void)
|
||||||
{
|
{
|
||||||
ASSERT(OwnsLock());
|
ASSERT(!OwnsLock());
|
||||||
|
|
||||||
|
ObjectLock olock(this);
|
||||||
|
|
||||||
if (!m_Properties) {
|
if (!m_Properties) {
|
||||||
DebugHint dhint;
|
DebugHint dhint;
|
||||||
@ -186,15 +188,7 @@ DynamicObject::Ptr ConfigItem::Commit(void)
|
|||||||
if (IsAbstract())
|
if (IsAbstract())
|
||||||
return DynamicObject::Ptr();
|
return DynamicObject::Ptr();
|
||||||
|
|
||||||
Dictionary::Ptr properties;
|
DynamicObject::Ptr dobj = dtype->CreateObject(GetProperties());
|
||||||
|
|
||||||
{
|
|
||||||
ObjectLock olock(this);
|
|
||||||
|
|
||||||
properties = GetProperties();
|
|
||||||
}
|
|
||||||
|
|
||||||
DynamicObject::Ptr dobj = dtype->CreateObject(properties);
|
|
||||||
dobj->SetDebugInfo(m_DebugInfo);
|
dobj->SetDebugInfo(m_DebugInfo);
|
||||||
dobj->Register();
|
dobj->Register();
|
||||||
|
|
||||||
@ -307,10 +301,7 @@ void ConfigItem::WriteObjectsFile(const String& filename)
|
|||||||
persistentItem->Set("type", item->GetType());
|
persistentItem->Set("type", item->GetType());
|
||||||
persistentItem->Set("name", item->GetName());
|
persistentItem->Set("name", item->GetName());
|
||||||
persistentItem->Set("abstract", item->IsAbstract());
|
persistentItem->Set("abstract", item->IsAbstract());
|
||||||
{
|
|
||||||
ObjectLock olock(item);
|
|
||||||
persistentItem->Set("properties", item->GetProperties());
|
persistentItem->Set("properties", item->GetProperties());
|
||||||
}
|
|
||||||
persistentItem->Set("debug_hints", item->GetDebugHints());
|
persistentItem->Set("debug_hints", item->GetDebugHints());
|
||||||
|
|
||||||
String json = JsonEncode(persistentItem);
|
String json = JsonEncode(persistentItem);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user