Important: Please read the Qt Code of Conduct -

[Solved] QML gc() destroys dynamically created objects in array

  • I fill a javascript array with dynamically created, unparented objects through Component.create(). After calling gc(), the objects are destroyed. Is this as intended, and why? Won't this result in erroneous behaviour when the garbage collector triggers itself?

    My bad. I stored a child object into the array, but not the "root", leaving it unreferenced. gc() obviously destroyed the parent with all the childs belonging to it.

Log in to reply