dlr-gtlab / gtlab-core

GTlab Core Framework
https://www.gtlab.de
Other
7 stars 2 forks source link

Merging property container values triggers destruction of property connections #571

Closed rainman110 closed 9 months ago

rainman110 commented 1 year ago

In GitLab by @rainman110 on Jul 11, 2023, 13:16

When using a property entry as a source for a property connection, the connection will be deleted when the parent object is merged with it's own memento.

This pseudo code will trigger the behaviour

MyObject o;
// o has a connection to a container entry
auto myObjectWithContainer = o.getChild("MyChildWithContainer");

auto memento = myObjectWithContainer.toMemento();
myObjectWithContainer.fromMemento(memento);
// !!! now, the connection is deleted
rainman110 commented 1 year ago

In GitLab by @rainman110 on Jul 11, 2023, 13:18

The reason is the clear call in gt_objectmemento.cpp : readStructContainer.

This implementation is not correct due to several reasons:

rainman110 commented 1 year ago

In GitLab by @rainman110 on Jul 11, 2023, 13:19

@marvinoe21 This is the bug you are experiencing. I found the reason, why the connection is cleared. I'll work on a fix.

rainman110 commented 1 year ago

In GitLab by @rainman110 on Jul 11, 2023, 13:19

created branch 571-merging-property-container-values-triggers-destruction-of-property-connections to address this issue

rainman110 commented 1 year ago

In GitLab by @rainman110 on Jul 11, 2023, 14:21

mentioned in commit 6dce22d130951db35c8e826cc9fc97b2c131a21e

rainman110 commented 1 year ago

In GitLab by @rainman110 on Aug 15, 2023, 14:50

mentioned in commit 5004e94510d0380ea7d5e5c7d474a8037332a277