aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4qobjectwrapper.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <[email protected]>2014-11-19 15:07:30 +0100
committerSimon Hausmann <[email protected]>2014-11-20 12:26:27 +0100
commite6db292366fa6ad25536fee08b2a972ea617d968 (patch)
tree1348661c4a5c658cc5955486bba0c620505808e4 /src/qml/jsruntime/qv4qobjectwrapper.cpp
parent5f3792cd32905ba9bc5483f6447b8fc693216bb4 (diff)
Get rid of one PersistentValue usage
We don't need to store a PersistentValue in a place that is reachable through regular object marking. Change-Id: I2a8764970e6d37b707921c65e6066d33c558576c Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 147f27ee37..75006bfe5c 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -1765,8 +1765,8 @@ Heap::QObjectMethod::QObjectMethod(QV4::ExecutionContext *scope, QObject *object
: Heap::FunctionObject(scope)
, object(object)
, index(index)
- , qmlGlobal(qmlGlobal)
{
+ this->qmlGlobal = qmlGlobal;
setVTable(QV4::QObjectMethod::staticVTable());
subtype = WrappedQtMethod;
}
@@ -1875,7 +1875,7 @@ ReturnedValue QObjectMethod::callInternal(CallData *callData)
if (method.isV4Function()) {
QV4::ScopedValue rv(scope, QV4::Primitive::undefinedValue());
- QV4::ScopedValue qmlGlobal(scope, d()->qmlGlobal.value());
+ QV4::ScopedValue qmlGlobal(scope, d()->qmlGlobal);
QQmlV4Function func(callData, rv, qmlGlobal,
QmlContextWrapper::getContext(qmlGlobal),
v8Engine);
@@ -1894,6 +1894,11 @@ ReturnedValue QObjectMethod::callInternal(CallData *callData)
}
}
+void QObjectMethod::markObjects(Heap::Base *that, ExecutionEngine *e)
+{
+ static_cast<QObjectMethod::Data*>(that)->qmlGlobal.mark(e);
+}
+
DEFINE_OBJECT_VTABLE(QObjectMethod);
Heap::QmlSignalHandler::QmlSignalHandler(QV4::ExecutionEngine *engine, QObject *object, int signalIndex)