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

Crash when reparenting QML Canvas items

    XMLWordPrintable

Details

    • All
    • 8ad8a5ddec05832c34f0cab3c8cf6530ea6c66c8

    Description

      When a Canvas item gets reparented to null and back, if the context2d was saved as a property, we get a crash with the following backtrace:

      #6 QVector<QPainterPath::Element>::size (this=0x39) at ../../include/QtCore/../../src/corelib/tools/qvector.h:87
      #7 QPainterPath::elementCount (this=this@entry=0x55e273085008) at painting/qpainterpath.cpp:483
      #8 0x00007f25b92f0f94 in QTransform::map (this=this@entry=0x7ffd751df6e0, path=...) at painting/qtransform.cpp:1671
      #9 0x00007f25ba6623fb in QQuickContext2D::setTransform (this=this@entry=0x55e273084f00, a=0.16866666078567505, b=b@entry=0, c=c@entry=0, d=d@entry=0.16866666078567505, e=e@entry=0, f=f@entry=0) at items/context2d/qquickcontext2d.cpp:3539
      #10 0x00007f25ba662668 in QQuickJSContext2DPrototype::method_setTransform (b=<optimized out>, thisObject=0x7f25992075e8, argv=0x7f25992075f0, argc=6) at items/context2d/qquickcontext2d.cpp:1164
      #11 0x00007f25b9724a28 in QV4::FunctionObject::call (argc=6, argv=0x7f25992075f0, thisObject=0x7f25992075e8, this=<optimized out>) at jsruntime/qv4functionobject_p.h:163
      #12 QV4::Runtime::method_callProperty (engine=0x55e26fb3cdd0, base=0x7f25992075e8, nameIndex=<optimized out>, argv=0x7f25992075f0, argc=6) at jsruntime/qv4runtime.cpp:1062

       

      the context2d property has clearly not been resetted when the context got deleted. Now that's arguably not good 1ml code, but it should not cause a runtime crash.

       

      In order to reproduce, run crash.qml in qmlscene and click on the button 2 times

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              notmart Marco Martin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes