I solved setting the parent of TraitObject to the C++ object that creates and maintains it.
In this way, the QML does not take ownership because it see that has a parent and it suppose that the parent manages the object.
↧