Skip to content
Snippets Groups Projects
Commit c22e0a03 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Init class segment before instance segment

parent f927794e
No related branches found
No related tags found
No related merge requests found
......@@ -86,8 +86,6 @@ namespace armarx::armem::server::obj
{
workingMemory.name() = defaultMemoryName;
instance::SegmentAdapter::init();
const auto initSegmentWithCatch = [&](const std::string & segmentName, const auto&& fn)
{
try
......@@ -108,11 +106,15 @@ namespace armarx::armem::server::obj
}
};
// Class segment needs to be initialized before instance segment,
// as the instance segment may refer to and search through the class segment.
initSegmentWithCatch("class", [&]()
{
classSegment.init();
});
instance::SegmentAdapter::init();
initSegmentWithCatch("articulated object class", [&]()
{
articulatedObjectClassSegment.init();
......@@ -206,7 +208,6 @@ namespace armarx::armem::server::obj
void ObjectMemory::RemoteGui_update()
{
// Non-atomic variables need to be guarded by a mutex if accessed by multiple threads
tab->instance.update(*this);
tab->clazz.update(classSegment);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment