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

Crash when a texture is deleted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • 6.4.1
    • 6.4.0
    • Quick: 3D
    • None
    • Windows
    • 28fba2dc5a (qt/qtquick3d/6.4) 28fba2dc5a (qt/tqtc-qtquick3d/6.4) 28fba2dc5a (qt/qtquick3d/6.4.1) 28fba2dc5a (qt/tqtc-qtquick3d/6.4.1)

      When textures are deleted they are not cleaned up from custom materials. If a custom material doesn't have parent node assigned (another questing why it may happen), when invalid texture pointers are dereferenced the application crashes.
      To reproduce:
      Run the attached example and set a break point to:
      QQuick3DCustomMaterial::setDynamicTextureMap
      Textures are dynamically created via Timer, set to a custom material and deleted.
      Whenever a texture is created it is added to m_dynamicTextureMaps, but the texture is never cleaned up from the array when it is deleted.

      Crash happens if condition (mat.material->parentItem() == nullptr) is met in:
      QQuick3DModel::qmlClearMaterials
      It tries to access the textures in QQuick3DCustomMaterial::itemChange, but the references in m_dynamicTextureMaps are not valid.

        1. skinning.7z
          4 kB
        2. stack.txt
          22 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.graphics.and.multimedia Qt Graphics Team
            alexey89 alexey89
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes