diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-12-02 08:53:29 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-12-06 08:35:36 +0100 |
commit | d0ff4bbf69ebaf34a6108b3406bf67451e8778d2 (patch) | |
tree | ff99e5c6cc9d37c9c80c553ca729e39540c21035 /sources/shiboken6/ApiExtractor/enclosingclassmixin.h | |
parent | 2d7c438cc4c13b22bbe45e937cbdb4215239fd29 (diff) |
shiboken6: Use smart pointers for AbstractMetaClass instances
Change-Id: I101ca8ceea6ffa63ca8bd03e2e9adf7531cb8f80
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/enclosingclassmixin.h')
-rw-r--r-- | sources/shiboken6/ApiExtractor/enclosingclassmixin.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sources/shiboken6/ApiExtractor/enclosingclassmixin.h b/sources/shiboken6/ApiExtractor/enclosingclassmixin.h index 31aeb9285..0fe8445ac 100644 --- a/sources/shiboken6/ApiExtractor/enclosingclassmixin.h +++ b/sources/shiboken6/ApiExtractor/enclosingclassmixin.h @@ -4,16 +4,21 @@ #ifndef ENCLOSINGCLASSMIXIN_H #define ENCLOSINGCLASSMIXIN_H +#include "abstractmetalang_typedefs.h" + class AbstractMetaClass; class EnclosingClassMixin { public: - const AbstractMetaClass *enclosingClass() const { return m_enclosingClass; } - void setEnclosingClass(const AbstractMetaClass *cls) { m_enclosingClass = cls; } - const AbstractMetaClass *targetLangEnclosingClass() const; + + const AbstractMetaClassCPtr enclosingClass() const + { return m_enclosingClass.toStrongRef(); } + void setEnclosingClass(const AbstractMetaClassCPtr &cls) + { m_enclosingClass = cls.toWeakRef(); } + AbstractMetaClassCPtr targetLangEnclosingClass() const; private: - const AbstractMetaClass *m_enclosingClass = nullptr; + QWeakPointer<const AbstractMetaClass> m_enclosingClass; }; #endif // ENCLOSINGCLASSMIXIN_H |