Using "new Object" in QML/JavaScript are garbage collected correctly?

  • Hi all,

    I'm using QML Quick 1.1 with Qt 4.8.6 on windows desktop.
    The GUI of my application is completely written in QML. The GUI logic is done via script files and uses JavaScript.

    Because some components like a property dialog is dynamically created I do following to get informed about the values: When one values was changed I iterate about all items, get their values, put the items name and value into a map and pass it to my C++ class.

    That works, no problem.
    function valueChanged()
    var values = new Object

    for (var i = 0; i < column.children.length; i++) {

    values[column.children[i].objectName] = column.children[i].text


    The "values" is a map, more precise a JavaScript Object with "new" created.

    My question here:
    What happens with the "values" after leaving the function? Is it destroyed by garbage collector? Or does it exists furher because I passed it to the C++ class?

    Thanks a lot...

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.