From ef7544bb5c6156462d169954c55afd38141e5a74 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 8 Jun 2021 17:27:23 +0200 Subject: Allow property observers on readonly properties This makes it necessary to tolerate evaluate() calls after the engine is gone. With non-QProperty properties this can't happen as the engine controls the observers. Change-Id: Ia700a10ad847b8a174b2346a4ad7a4de7afb0c83 Reviewed-by: Fabian Kosmale --- src/qml/qml/qqmlboundsignal.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/qml/qml/qqmlboundsignal.cpp') diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index 0dfbf1faee..665d4e6c75 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -175,12 +175,16 @@ QString QQmlBoundSignalExpression::expression() const // Changes made here may need to be made there and vice versa. void QQmlBoundSignalExpression::evaluate(void **a) { - Q_ASSERT (engine()); - if (!expressionFunctionValid()) return; QQmlEngine *qmlengine = engine(); + + // If there is no engine, we have no way to evaluate anything. + // This can happen on destruction. + if (!qmlengine) + return; + QQmlEnginePrivate *ep = QQmlEnginePrivate::get(qmlengine); QV4::ExecutionEngine *v4 = qmlengine->handle(); QV4::Scope scope(v4); -- cgit v1.2.3