aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlincubator.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-03-28 15:31:29 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-04-09 13:23:41 +0000
commit740462a87480e1b347d833321cdcf316840c1c13 (patch)
treeb599c49f22bc1bc58f7c0e946b8af2a2ec379e99 /src/qml/qml/qqmlincubator.cpp
parentd1a5adb5d6d6d64bf648cbeda70663751c8b982d (diff)
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 <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r--src/qml/qml/qqmlincubator.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index 4546a4423f..df168960c6 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -367,10 +367,8 @@ finishIncubate:
enginePriv->inProgressCreations--;
if (0 == enginePriv->inProgressCreations) {
- while (enginePriv->erroredBindings) {
- enginePriv->warning(enginePriv->erroredBindings);
- enginePriv->erroredBindings->removeError();
- }
+ while (enginePriv->erroredBindings)
+ enginePriv->warning(enginePriv->erroredBindings->removeError());
}
} else if (!creator.isNull()) {
vmeGuard.guard(creator.data());
@@ -575,10 +573,8 @@ void QQmlIncubator::clear()
enginePriv->inProgressCreations--;
if (0 == enginePriv->inProgressCreations) {
- while (enginePriv->erroredBindings) {
- enginePriv->warning(enginePriv->erroredBindings);
- enginePriv->erroredBindings->removeError();
- }
+ while (enginePriv->erroredBindings)
+ enginePriv->warning(enginePriv->erroredBindings->removeError());
}
}