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

Dangling pointer in touch events processing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12
    • None

    Description

      Method

      QQuickWindowPrivate::deliverPressOrReleaseEvent

      Build array of QQuickItems under touch points

       QVector<QQuickItem *> targetItems

      then iterate through this array and send events, but during this job some QQuickItem could be destroyed, which leads us to corrupted pointers in the array.

      Problem detected when we bind 'Item.layer.enabled' to focus state, like in attached file
      main.qml

      Try to launch 'main.qml' on device with multitouch  support, then press one red rectangle with one finger and second with another finger while first rectangle still pressed - application crash immediately.

      In my opinion best solution is to change  QVector<QQuickItem *> to QVector<QPoint<QQuickItem> > and check array items for 'null', but we also provide solution for exactly described case  by using QQuickItemLayer::m_effect->deleteLater instead of delete it instantly

      There a change for it: 
      https://codereview.qt-project.org/c/qt/qtdeclarative/+/321499

      Attachments

        For Gerrit Dashboard: QTBUG-88408
        # Subject Branch Project Status CR V

        Activity

          People

            srutledg Shawn Rutledge
            roman_genkhel Roman Genhel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: