Hi,
The code above is from DataObjectListImpl.cpp. As far as I know, when a DO
is removed from a non-containment Property, it should not loose its
container. Although, when it's removed from a list it's not checking if the
property is containment or not, it always set the removed DO container as
NULL.
DataObjectPtr DataObjectListImpl::remove(unsigned int index)
{
validateIndex(index);
if (container != 0)
{
container->logChange(pindex);
}
DataObjectPtr d = (*this)[index];
// log deletion only if the list is of data objects.
if (theFactory != 0)
{
const Type& t = theFactory->getType(typeURI,typeName);
const Property& p = container->getPropertyFromIndex(pindex);
if (!t.isDataType() && !p.isReference())
{
(getVec()[index])->logDeletion();
}
}
plist.erase(plist.begin()+index);
DataObject* dob = getRawPointer(d);
((DataObjectImpl*)dob)->setContainer(0); // <<<<<<< should check if is
a contaiment property before execute this operation
return d;
}
If everything is ok, I will create a jira for that.
Adriano Crestani