aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickloader_p_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-05-08 15:41:42 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-05-11 09:40:15 +0000
commit8fd84a4ad487009ec493ad26af50e7a9f5a454f9 (patch)
tree253f16decc55f34ba063e82e9d0e4f0d876d3146 /src/quick/items/qquickloader_p_p.h
parent54da8f6c86aa9cba99bcedcd58b40db938b5af9e (diff)
Improve ownership handling of Loader.sourceComponent
Avoid the allocation of a QV4::Persistent by using QQmlStrongJSQObjectReference for the source component property. No addition unit test added as commit adaedcb9ead1c536ff3d8fba0fb9f4fc262d4d45 introduced a test for this behavior. Change-Id: I1cc66ea5979af278e1be218639dead8933ffe8f0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/quick/items/qquickloader_p_p.h')
-rw-r--r--src/quick/items/qquickloader_p_p.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/items/qquickloader_p_p.h b/src/quick/items/qquickloader_p_p.h
index 7492527401..349b5c6c06 100644
--- a/src/quick/items/qquickloader_p_p.h
+++ b/src/quick/items/qquickloader_p_p.h
@@ -103,8 +103,7 @@ public:
QUrl source;
QQuickItem *item;
QObject *object;
- QQmlComponent *component;
- QV4::PersistentValue componentStrongReference; // To ensure GC doesn't delete components created by Qt.createComponent
+ QQmlStrongJSQObjectReference<QQmlComponent> component;
QQmlContext *itemContext;
QQuickLoaderIncubator *incubator;
QV4::PersistentValue initialPropertyValues;