aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4sequenceobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4sequenceobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4sequenceobject.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp
index 058964969c..529c395c26 100644
--- a/src/qml/jsruntime/qv4sequenceobject.cpp
+++ b/src/qml/jsruntime/qv4sequenceobject.cpp
@@ -354,12 +354,13 @@ public:
bool operator()(typename Container::value_type lhs, typename Container::value_type rhs)
{
QV4::Managed *fun = this->m_compareFn.asManaged();
+ ValueScope scope(fun->engine());
ScopedCallData callData(fun->engine(), 2);
callData->args[0] = convertElementToValue(this->m_ctx->engine, lhs);
callData->args[1] = convertElementToValue(this->m_ctx->engine, rhs);
callData->thisObject = QV4::Value::fromObject(this->m_ctx->engine->globalObject);
- QV4::Value result = fun->call(callData);
- return result.toNumber() < 0;
+ QV4::ScopedValue result(scope, fun->call(callData));
+ return result->toNumber() < 0;
}
private: