From fa48382c492097d06d7ce066ac36dba04fd5e801 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 15 Oct 2020 12:16:08 +0200 Subject: QDeferredPointer: Remove the factory before executing it Only this way we avoid infinite recursion on cyclic references. Change-Id: I4d6323a093d17f7d55965dc40f9dc5f1a647df9c Reviewed-by: Fabian Kosmale --- src/qmlcompiler/qqmljsscope_p.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/qmlcompiler/qqmljsscope_p.h') 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 { 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; -- cgit v1.2.3