aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcomponent.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-10-18 08:33:26 +0200
committerLiang Qi <liang.qi@qt.io>2016-10-18 08:33:26 +0200
commitf04c2c40fd7ee91e5cbff2ca4df0fdc30dfbbcd5 (patch)
tree4e96d097987deb8d4d1a963e911dcbd1641a8502 /src/qml/qml/qqmlcomponent.cpp
parent0da811cdfebdae1d96c99fe681e6a776e73d2f7f (diff)
parente76ed6a2655894bd671ee7397a15f2e57cfc8d33 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/qml/jsruntime/qv4variantobject.cpp src/qml/types/qquickworkerscript.cpp src/quick/scenegraph/util/qsgdefaultpainternode_p.h tools/qmljs/qmljs.cpp Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
Diffstat (limited to 'src/qml/qml/qqmlcomponent.cpp')
-rw-r--r--src/qml/qml/qqmlcomponent.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index b78028dcf9..6ebcd142fb 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -1058,9 +1058,9 @@ namespace QV4 {
namespace Heap {
struct QmlIncubatorObject : Object {
- QmlIncubatorObject(QQmlIncubator::IncubationMode = QQmlIncubator::Asynchronous);
- ~QmlIncubatorObject() { parent.destroy(); }
- QScopedPointer<QQmlComponentIncubator> incubator;
+ void init(QQmlIncubator::IncubationMode = QQmlIncubator::Asynchronous);
+ inline void destroy();
+ QQmlComponentIncubator *incubator;
QQmlQPointer<QObject> parent;
QV4::Value valuemap;
QV4::Value statusChanged;
@@ -1389,7 +1389,7 @@ void QQmlComponent::incubateObject(QQmlV4Function *args)
r->d()->qmlContext = v4->qmlContext();
r->d()->parent = parent;
- QQmlIncubator *incubator = r->d()->incubator.data();
+ QQmlIncubator *incubator = r->d()->incubator;
create(*incubator, creationContext());
if (incubator->status() == QQmlIncubator::Null) {
@@ -1484,13 +1484,20 @@ QQmlComponentExtension::~QQmlComponentExtension()
{
}
-QV4::Heap::QmlIncubatorObject::QmlIncubatorObject(QQmlIncubator::IncubationMode m)
- : valuemap(QV4::Primitive::undefinedValue())
- , statusChanged(QV4::Primitive::undefinedValue())
+void QV4::Heap::QmlIncubatorObject::init(QQmlIncubator::IncubationMode m)
{
+ Object::init();
+ valuemap = QV4::Primitive::undefinedValue();
+ statusChanged = QV4::Primitive::undefinedValue();
parent.init();
qmlContext = nullptr;
- incubator.reset(new QQmlComponentIncubator(this, m));
+ incubator = new QQmlComponentIncubator(this, m);
+}
+
+void QV4::Heap::QmlIncubatorObject::destroy() {
+ delete incubator;
+ parent.destroy();
+ Object::destroy();
}
void QV4::QmlIncubatorObject::setInitialState(QObject *o)