Fix crash in QQuickLoader when source component is garbage collected
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 5 Dec 2013 15:21:03 +0000 (16:21 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 6 Dec 2013 14:18:47 +0000 (15:18 +0100)
commitadaedcb9ead1c536ff3d8fba0fb9f4fc262d4d45
tree7d798f62b3ad61a038468e4e418899388966f968
parent433949df18625e5a04d8e83908ee51f703380f21
Fix crash in QQuickLoader when source component is garbage collected

It may happen that the QQuickLoader is the last entity left in the system
holding a reference to the QQmlComponent *sourceComponent. We have to let the
garbage collector know about that by keeping a persistent value for it.

Task-number: QTBUG-35334
Change-Id: I715864440378fd9dd4f2d5ef8ff2f171c81ed7ef
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/quick/items/qquickloader.cpp
src/quick/items/qquickloader_p_p.h
tests/auto/quick/qquickloader/data/SimpleTestComponent.qml [new file with mode: 0644]
tests/auto/quick/qquickloader/data/sourceComponentGarbageCollection.qml [new file with mode: 0644]
tests/auto/quick/qquickloader/tst_qquickloader.cpp