diff options
author | Jaeyoon Jung <jaeyoon.jung@lge.com> | 2018-02-08 14:24:20 +0900 |
---|---|---|
committer | Dominik Holland <dominik.holland@qt.io> | 2020-06-16 12:36:42 +0200 |
commit | 2bad18ff33503ec291917894aca1740fb419d7c9 (patch) | |
tree | b5e3f2b494b1402ddbfd91375bf7777b49a86e1d /src/qml | |
parent | 6adf57e8f3dac1912f532cb6956d989b8a148742 (diff) | |
download | qtdeclarative-2bad18ff33503ec291917894aca1740fb419d7c9.tar.gz |
Warn circular dependency when loading types
Detect a circular dependency between two QML types and print a warning
message if found.
Task-number: QTBUG-83354
Change-Id: I826b28775ba3212ccccaeb56d50b64fec6f38ea9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit f0c08dc2175cffadb73e06d2cc69a152002e0df0)
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmldatablob.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/qml/qqmldatablob.cpp b/src/qml/qml/qqmldatablob.cpp index b22e46b69c..82e6fcf56c 100644 --- a/src/qml/qml/qqmldatablob.cpp +++ b/src/qml/qml/qqmldatablob.cpp @@ -359,6 +359,12 @@ void QQmlDataBlob::addDependency(QQmlDataBlob *blob) m_waitingFor.append(blob); blob->m_waitingOnMe.append(this); + + // Check circular dependency + if (m_waitingOnMe.indexOf(blob) >= 0) { + qWarning() << "Cyclic dependency detected between" << this->url().toString() << "and" << blob->url().toString(); + m_data.setStatus(Error); + } } /*! |