COLLADA_DOM daeIntegrationObjects cleanup


I’m experimenting leaks with daeIntegrationObjects.
I had a look to the code and saw:

class daeIntegrationObject
    /** A smartRef to the element associated with this integration object. */
    daeElementRef _element;

class daeElement
    daeIntegrationObject* _intObject;
        if (_intObject)

I’m quite confused about what owns what here.

In the integration example, I saw:

class intGeometry : public daeIntegrationObject
    daeElement* _element;

which would make daeElement own daeIntegrationObject

Do I have to do as in the integration example (ignore the daeElementRef daeIntegrationObject::_element) or do I miss something ?


I don’t know why the integration sample redefines _element.
It is not needed, you can use the _element defined in the daeIntegrationObject base class.

And as far as I know, the daeElement owns the daeIntegrationObject.


Well, the sample way seems to be right way.
If I use the _element defined in the daeIntegrationObject base class, the daeIntegrationObject adds a ref count on _element, both objects own each other and I get a leak.
I used a plain old pointer instead of daeElementRef _element in my integration objects and it works as expected: the daeElement destroys the daeIntegrationObject.

  • Guillaume