aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontextwrapper.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/qqmlcontextwrapper.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/qqmlcontextwrapper.cpp')
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index 53353f6f1a..83ef8c6230 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -83,7 +83,7 @@ ReturnedValue QmlContextWrapper::qmlScope(QV8Engine *v8, QQmlContextData *ctxt,
ExecutionEngine *v4 = QV8Engine::getV4(v8);
Scope valueScope(v4);
- Scoped<QmlContextWrapper> w(valueScope, new (v4) QmlContextWrapper::Data(v8, ctxt, scope));
+ Scoped<QmlContextWrapper> w(valueScope, v4->memoryManager->alloc<QmlContextWrapper>(v8, ctxt, scope));
return w.asReturnedValue();
}
@@ -97,7 +97,7 @@ ReturnedValue QmlContextWrapper::urlScope(QV8Engine *v8, const QUrl &url)
context->isInternal = true;
context->isJSContext = true;
- Scoped<QmlContextWrapper> w(scope, new (v4) QmlContextWrapper::Data(v8, context, 0, true));
+ Scoped<QmlContextWrapper> w(scope, v4->memoryManager->alloc<QmlContextWrapper>(v8, context, (QObject*)0, true));
w->d()->isNullWrapper = true;
return w.asReturnedValue();
}
@@ -415,7 +415,7 @@ ReturnedValue QmlContextWrapper::idObjectsArray()
if (!d()->idObjectsWrapper) {
ExecutionEngine *v4 = engine();
Scope scope(v4);
- Scoped<QQmlIdObjectsArray> a(scope, new (v4) QQmlIdObjectsArray::Data(v4, this));
+ Scoped<QQmlIdObjectsArray> a(scope, v4->memoryManager->alloc<QQmlIdObjectsArray>(v4, this));
d()->idObjectsWrapper = a.getPointer();
}
return d()->idObjectsWrapper->asReturnedValue();