diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-25 15:24:50 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:39 +0200 |
commit | 150731fc68bcf823bec40729285813d902990cb7 (patch) | |
tree | 7af619f4bc8fac030bc162ce6ead2e2a7be86783 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
parent | c79cc3f30d395c94d4f14b978903d7db4ad871dc (diff) |
Remove more direct QV4::Value usage
Remove Value::fromString(String *), and make
Encode safe against encoding raw Managed * pointers.
Change-Id: Ibca4668e1cbeaf85c78169d14386281659d33ef6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 0f866a1331..6870cd693c 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -328,14 +328,14 @@ ReturnedValue QObjectWrapper::getQmlProperty(ExecutionContext *ctx, QQmlContextD return QV4::QObjectMethod::create(ctx->engine->rootContext, m_object, result->coreIndex, qmlcontextobject.asValue()).asReturnedValue(); } else if (result->isSignalHandler()) { - QV4::QmlSignalHandler *handler = new (ctx->engine->memoryManager) QV4::QmlSignalHandler(ctx->engine, m_object, result->coreIndex); + QV4::Scoped<QV4::QmlSignalHandler> handler(scope, new (ctx->engine->memoryManager) QV4::QmlSignalHandler(ctx->engine, m_object, result->coreIndex)); QV4::ScopedString connect(scope, ctx->engine->newIdentifier(QStringLiteral("connect"))); QV4::ScopedString disconnect(scope, ctx->engine->newIdentifier(QStringLiteral("disconnect"))); handler->put(connect, QV4::ScopedValue(scope, ctx->engine->functionClass->prototype->get(connect))); handler->put(disconnect, QV4::ScopedValue(scope, ctx->engine->functionClass->prototype->get(disconnect))); - return QV4::Value::fromObject(handler).asReturnedValue(); + return handler.asReturnedValue(); } else { return QV4::QObjectMethod::create(ctx->engine->rootContext, m_object, result->coreIndex).asReturnedValue(); } @@ -598,7 +598,7 @@ ReturnedValue QObjectWrapper::create(ExecutionEngine *engine, QQmlData *ddata, Q if (ddata->propertyCache) ddata->propertyCache->addref(); } - return Value::fromObject(new (engine->memoryManager) QV4::QObjectWrapper(engine, object)).asReturnedValue(); + return (new (engine->memoryManager) QV4::QObjectWrapper(engine, object))->asReturnedValue(); } QV4::ReturnedValue QObjectWrapper::get(Managed *m, const StringRef name, bool *hasProperty) |