Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] QML gc() destroys dynamically created objects in array
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Peter K
    wrote on last edited by
    #1

    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?

    [Update]
    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved