diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-11-11 09:38:22 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-11-17 18:14:28 +0100 |
commit | f499c71c3b3f78920be192d35df7e2c8d18e2f1b (patch) | |
tree | 1cf53d8b089cfcb054c395bb288951c945f6e582 /sources/shiboken6/ApiExtractor/abstractmetalang.h | |
parent | cf4f1a7488ba3202b44081eade36debf1d665e8f (diff) |
shiboken6: Use smart pointers for the TypeEntry classes
TypeEntry instances were previously stored and passed as raw pointers,
which made it difficult to track ownership, particularly when
synthesized classes were added. Change it to use QSharedPointer.
Change-Id: I3612efbc5d467ebeac9aa5dda86c7439bbd03ddd
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h')
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetalang.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h index 8e8c451c4..e0654b69f 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h @@ -114,8 +114,8 @@ public: bool canAddDefaultCopyConstructor() const; /// Return type entry of the base class that declares the parent management - const TypeEntry *parentManagementEntry() const; - bool hasParentManagement() const { return parentManagementEntry() != nullptr; } + TypeEntryCPtr parentManagementEntry() const; + bool hasParentManagement() const { return !parentManagementEntry().isNull(); } void addSynthesizedComparisonOperators(); @@ -248,9 +248,9 @@ public: const QStringList &baseClassNames() const; void setBaseClassNames(const QStringList &names); - const ComplexTypeEntry *typeEntry() const; - ComplexTypeEntry *typeEntry(); - void setTypeEntry(ComplexTypeEntry *type); + ComplexTypeEntryCPtr typeEntry() const; + ComplexTypeEntryPtr typeEntry(); + void setTypeEntry(const ComplexTypeEntryPtr &type); /// Returns the global hash function as found by the code parser QString hashFunction() const; @@ -323,9 +323,9 @@ public: static const AbstractMetaClass *findClass(const AbstractMetaClassCList &classes, QStringView name); static AbstractMetaClass *findClass(const AbstractMetaClassList &classes, - const TypeEntry *typeEntry); + const TypeEntryCPtr &typeEntry); static const AbstractMetaClass *findClass(const AbstractMetaClassCList &classes, - const TypeEntry *typeEntry); + const TypeEntryCPtr &typeEntry); const AbstractMetaClass *findBaseClass(const QString &qualifiedName) const; static std::optional<AbstractMetaEnumValue> findEnumValue(const AbstractMetaClassList &classes, |