From 002a5d4303b3b182ae4abc4a752c49787c1c2821 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 15 Jan 2015 11:36:57 +0100 Subject: Get rid of most uses of ValueRef Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlvaluetypewrapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/qml/qqmlvaluetypewrapper.cpp') diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index 1e138be341..b80472559b 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -337,7 +337,7 @@ ReturnedValue QQmlValueTypeWrapper::get(Managed *m, String *name, bool *hasPrope #undef VALUE_TYPE_ACCESSOR } -void QQmlValueTypeWrapper::put(Managed *m, String *name, const ValueRef value) +void QQmlValueTypeWrapper::put(Managed *m, String *name, const Value &value) { Q_ASSERT(m->as()); ExecutionEngine *v4 = static_cast(m)->engine(); @@ -389,7 +389,7 @@ void QQmlValueTypeWrapper::put(Managed *m, String *name, const ValueRef value) cacheData.valueTypeCoreIndex = pd->coreIndex; cacheData.valueTypePropType = property.userType(); - QV4::Scoped bindingFunction(scope, f); + QV4::Scoped bindingFunction(scope, (const Value &)f); bindingFunction->initBindingLocation(); newBinding = new QQmlBinding(value, reference->d()->object, context); -- cgit v1.2.3