From 740462a87480e1b347d833321cdcf316840c1c13 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 28 Mar 2018 15:31:29 +0200 Subject: Fix crash when QML engine warning handler feeds errors back into QML When a QQmlEngine warning handler that's called during component instantiation results in subsequent component instantiations, either via the signal or via a Qt message handler like in the bug report, then we might end up modifying the linked list of errored bindings before returning from the QQmlEnginePrivate::warning() call. The easy fix is to extract the QQmlError, unlink the delayed error from the linked list and then deliver the error to the QQmlEngine. Change-Id: I6b7be61b57b35636282595937046ff76091144a3 Task-number: QTBUG-53293 Reviewed-by: Lars Knoll --- src/qml/qml/qqmljavascriptexpression.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/qml/qqmljavascriptexpression.cpp') diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 3daa107b64..40cf1417d0 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -455,7 +455,7 @@ void QQmlJavaScriptExpression::createQmlBinding(QQmlContextData *ctxt, QObject * error->catchJavaScriptException(v4); error->setErrorObject(qmlScope); if (!error->addError(ep)) - ep->warning(error); + ep->warning(error->error()); return; } setupFunction(qmlContext, script.vmFunction); -- cgit v1.2.3