diff options
author | Liang Qi <liang.qi@qt.io> | 2017-06-06 20:18:01 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-06-06 20:18:01 +0000 |
commit | 5624e82d068ebab254239121810fc097af7fcb40 (patch) | |
tree | 27d4a45faaa7cf948a6700bc680c2684893f4e2e /src/qml/jsruntime/qv4qmlcontext.cpp | |
parent | d7b45f7dc1d5f28ecdb022c5a4c7673bc55257c8 (diff) | |
parent | c254cec22a2352a3fcab60244a6ab74f95d45ace (diff) |
Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev
Diffstat (limited to 'src/qml/jsruntime/qv4qmlcontext.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qmlcontext.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index c08dd7baa3..61d785066f 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -297,15 +297,15 @@ bool QQmlContextWrapper::put(Managed *m, String *name, const Value &value) void Heap::QmlContext::init(QV4::ExecutionContext *outerContext, QV4::QQmlContextWrapper *qml) { - Heap::ExecutionContext::init(outerContext->engine(), Heap::ExecutionContext::Type_QmlContext); - outer.set(engine, outerContext->d()); + Heap::ExecutionContext::init(Heap::ExecutionContext::Type_QmlContext); + outer.set(internalClass->engine, outerContext->d()); strictMode = false; callData = outer->callData; lookups = outer->lookups; constantTable = outer->constantTable; compilationUnit = outer->compilationUnit; - this->qml.set(engine, qml->d()); + this->qml.set(internalClass->engine, qml->d()); } Heap::QmlContext *QmlContext::createWorkerContext(ExecutionContext *parent, const QUrl &source, Value *sendFunction) @@ -327,7 +327,8 @@ Heap::QmlContext *QmlContext::createWorkerContext(ExecutionContext *parent, cons qml->QV4::Object::put(QV4::ScopedString(scope, scope.engine->newString(QStringLiteral("WorkerScript"))), api); qml->setReadOnly(true); - Heap::QmlContext *c = parent->d()->engine->memoryManager->alloc<QmlContext>(parent, qml); + Heap::QmlContext *c = scope.engine->memoryManager->alloc<QmlContext>(parent, qml); + Q_ASSERT(c->vtable() == staticVTable()); return c; } @@ -336,7 +337,8 @@ Heap::QmlContext *QmlContext::create(ExecutionContext *parent, QQmlContextData * Scope scope(parent); Scoped<QQmlContextWrapper> qml(scope, scope.engine->memoryManager->allocObject<QQmlContextWrapper>(context, scopeObject)); - Heap::QmlContext *c = parent->d()->engine->memoryManager->alloc<QmlContext>(parent, qml); + Heap::QmlContext *c = scope.engine->memoryManager->alloc<QmlContext>(parent, qml); + Q_ASSERT(c->vtable() == staticVTable()); return c; } |