Another bugfix for the event order.

This commit is contained in:
Gunnar Beutner 2013-08-29 19:25:34 +02:00
parent a3eed67774
commit c9ec28440e
4 changed files with 11 additions and 9 deletions

View File

@ -292,6 +292,7 @@ void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
ASSERT(!object->IsActive());
Log(LogDebug, "base", "Restoring object '" + name + "' of type '" + type + "'.");
object->Deserialize(update, attributeTypes);
object->OnStateLoaded();
}
restored++;

View File

@ -282,15 +282,16 @@ void ConfigItem::ActivateItems(void)
/* restore the previous program state */
DynamicObject::RestoreObjects(Application::GetStatePath());
BOOST_FOREACH(const DynamicObject::Ptr& object, objects) {
object->OnStateLoaded();
}
BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
if (object->IsActive())
continue;
BOOST_FOREACH(const DynamicObject::Ptr& object, objects) {
Log(LogDebug, "config", "Activating object '" + object->GetName() + "' of type '" + object->GetType()->GetName() + "'");
object->Start();
Log(LogDebug, "config", "Activating object '" + object->GetName() + "' of type '" + object->GetType()->GetName() + "'");
object->Start();
ASSERT(object->IsActive());
ASSERT(object->IsActive());
}
}
}

View File

@ -246,7 +246,7 @@ void Host::UpdateSlaveServices(void)
ConfigItem::Ptr serviceItem = builder->Compile();
DynamicObject::Ptr dobj = serviceItem->Commit();
dobj->Start();
dobj->OnConfigLoaded();
}
}

View File

@ -194,7 +194,7 @@ void Service::UpdateSlaveNotifications(void)
ConfigItem::Ptr notificationItem = builder->Compile();
DynamicObject::Ptr dobj = notificationItem->Commit();
dobj->Start();
dobj->OnConfigLoaded();
}
}
}