From d444d21a517c45c0fda0bdf955cbda61e0088be6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 1 Feb 2016 09:33:38 +0100 Subject: Fix crash in Installer Framework when used with Qt 5.6 IFW uses QQmlV4Function in a QJSEngine environment, so there is no QML context. Up to commit cc98678f404cd49750076795f39b31bfa36c80c3 that would work. Let's fall back to the root context as scope if we don't have a qml context. Change-Id: Ib240746a95a0d16d61620f97abc31e4c74f36723 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4qobjectwrapper.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 8f471132b7..bcd97efee8 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -330,6 +330,8 @@ ReturnedValue QObjectWrapper::getProperty(ExecutionEngine *engine, QObject *obje } else if (property->isV4Function()) { Scope scope(engine); ScopedContext global(scope, engine->qmlContext()); + if (!global) + global = engine->rootContext(); return QV4::QObjectMethod::create(global, object, property->coreIndex); } else if (property->isSignalHandler()) { QmlSignalHandler::initProto(engine); -- cgit v1.2.3