aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-06-13 14:30:03 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:19 +0200
commitb393c405b7568e80628bc99501a9c53bbd0e678d (patch)
tree51280658b1ec97947a66c6afc503b23ae48f0d8d /src/qml/qml/qqmlobjectcreator.cpp
parent00a46fa07bf87c6ffa0d60b4a98b51685fdc1ef5 (diff)
Change the object allocation scheme
Instead of allocating the data directly, centralize the object and its ::Data allocation in one place in the memory manager. This is in preparation for additional pointer indirection later. Change-Id: I7880e1e7354b3258b6a8965be378cd09c9467d25 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 8162777172..9501b705ba 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -261,7 +261,7 @@ bool QQmlObjectCreator::populateDeferredProperties(QObject *instance)
QV4::ScopedValue scopeObjectProtector(valueScope, declarativeData->jsWrapper.value());
Q_UNUSED(scopeObjectProtector);
QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(QV8Engine::get(engine), context, _scopeObject));
- QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, new (v4) QV4::QmlBindingWrapper::Data(v4->rootContext, qmlScope));
+ QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, v4->memoryManager->alloc<QV4::QmlBindingWrapper>(v4->rootContext, qmlScope));
QV4::ExecutionContext *qmlContext = qmlBindingWrapper->context();
qSwap(_qmlContext, qmlContext);
@@ -1163,7 +1163,7 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
QV4::ScopedValue scopeObjectProtector(valueScope, ddata ? ddata->jsWrapper.value() : 0);
Q_UNUSED(scopeObjectProtector);
QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(QV8Engine::get(engine), context, _scopeObject));
- QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, new (v4) QV4::QmlBindingWrapper::Data(v4->rootContext, qmlScope));
+ QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, v4->memoryManager->alloc<QV4::QmlBindingWrapper>(v4->rootContext, qmlScope));
QV4::ExecutionContext *qmlContext = qmlBindingWrapper->context();
qSwap(_qmlContext, qmlContext);