Attributes are owned by the TaskContext and TaskContext::removeAttribute() or the respective Lua wrapper already destroys the instance returned by TaskContext::getAttribute(). The additional attr:delete() command triggers a segfault if the component has at least one attribute. The implementation of attributes is different from ports and properties with that respect, which are not cloned when they are added to the component interface.
On the other hand while adding attributes the instance created by Lua in Attribute_new() should be destroyed after it has been cloned and added to the TaskContext or TaskContext_addAttribute() must exchange the instance pointer in the Lua stack with the clone (not sure if this is possible).
Attributes are owned by the TaskContext and
TaskContext::removeAttribute()
or the respective Lua wrapper already destroys the instance returned byTaskContext::getAttribute()
. The additionalattr:delete()
command triggers a segfault if the component has at least one attribute. The implementation of attributes is different from ports and properties with that respect, which are not cloned when they are added to the component interface.On the other hand while adding attributes the instance created by Lua in
Attribute_new()
should be destroyed after it has been cloned and added to the TaskContext orTaskContext_addAttribute()
must exchange the instance pointer in the Lua stack with the clone (not sure if this is possible).