Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9705

Deleted QML Items are javascript unfriendly, and cause a crash too

    XMLWordPrintable

Details

    Description

      This is somewhat related to the comment here
      http://bugreports.qt.nokia.com/browse/QTBUG-9670?focusedCommentId=113191&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_113191
      and seen with QML compiled from qt/qt-qml and HEAD at 5eb8e749bdd60ce93737b96f8f736796dfa77281

      It seems a QML item that was added to a javascrip array and then deleted turn the
      array element into something that is neither null nor the string "null" yet its toString() return "null".
      (I guess it's some kind of tombstone QObject...)

      If dropTargets is a javascrip array containing QML items, of which the first three has been deleted and its toString() return
      "null,null,null,DragAndDropArea_QMLTYPE_94_QML_97(0x9ba2378),DragAndDropArea_QMLTYPE_171_QML_187(0x9abbbe0)"
      then

      var target = dropTargets[0];
      if(target.toString() == "null") 
      

      is true, but

      if(!target || target === null || target === undefined)
      

      is not, and

      if(target == "null") 
      

      cause this crash
      ASSERT: "scriptClass(scopeNode) == enginePrivate->contextClass" in file qml/qdeclarativeobjectscriptclass.cpp, line 171

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            aakenned Aaron Kennedy
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes