diff --git a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp index 5cf0df43721c50a0499860e4c8c32ee44bde0f81..bfa97db1e1afe59d2bd03bc47af21ea60fe3968f 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp +++ b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp @@ -442,10 +442,11 @@ namespace armarx::armem::gui { std::string name = memory.id().memoryName; - auto commit = armem::toCommit(memory); - if (memoryWriters.count(name) > 0) { + // we need to merge the current memory with the one from the disk. + // Please note that this may ignores coresegments, if not already existent + auto commit = armem::toCommit(memory); memoryWriters.at(name).commit(commit); } else @@ -456,10 +457,9 @@ namespace armarx::armem::gui // Please note: Here we assume that a memory server with the same name does not exist. // I think this assumption is ok, since nobody should use filepaths as memory name. // Nonetheless, we did not restrict the user to do so... - std::string virtualMemoryName = name + " (at " + path.string() + ")"; - wm::Memory virtualMemory(virtualMemoryName); - virtualMemory.update(commit, true, false); - memoryData[virtualMemoryName] = std::move(virtualMemory); + std::string virtualMemoryName = name;// + " (at " + path.string() + ")"; + memory.id().memoryName = virtualMemoryName; + memoryData[virtualMemoryName] = std::move(memory); } }