aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsscope_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-15 12:16:08 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-15 13:16:57 +0200
commitfa48382c492097d06d7ce066ac36dba04fd5e801 (patch)
tree6d8bc1d8b0ab829c09554ebe93fb3d6155b29d4b /src/qmlcompiler/qqmljsscope_p.h
parent3abe34472b56d32aa1b14f54aa8a0e2ebe4d5537 (diff)
QDeferredPointer: Remove the factory before executing it
Only this way we avoid infinite recursion on cyclic references. Change-Id: I4d6323a093d17f7d55965dc40f9dc5f1a647df9c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsscope_p.h')
-rw-r--r--src/qmlcompiler/qqmljsscope_p.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h
index df7aad840d..90696166e4 100644
--- a/src/qmlcompiler/qqmljsscope_p.h
+++ b/src/qmlcompiler/qqmljsscope_p.h
@@ -60,6 +60,8 @@ template<>
class QDeferredFactory<QQmlJSScope>
{
public:
+ QDeferredFactory() = default;
+
QDeferredFactory(QQmlJSImporter *importer, const QString &filePath) :
m_filePath(filePath), m_importer(importer)
{}
@@ -71,11 +73,6 @@ public:
return !m_filePath.isEmpty() && m_importer != nullptr;
}
- void clear() {
- m_filePath.clear();
- m_importer = nullptr;
- }
-
private:
QString m_filePath;
QQmlJSImporter *m_importer = nullptr;