aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetalang.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-05-24 09:31:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-05-27 20:10:21 +0200
commitadad8744d65c11bc78d1976e344aac1d4abb47aa (patch)
tree09200670406964db29472706e3576726ba78c487 /sources/shiboken6/ApiExtractor/abstractmetalang.h
parentb815111f8aefd89e01b966ecc86a8c77220d7e99 (diff)
shiboken6: Introduce an attribute for parent ownership heuristics
The parent ownership heuristics cause some unintended ownership transfers to be generated that can cause crashes. However, completely removing them would mean to have to explicitly specify it in each QObject-derived class constructor. To improve this, introduce an attribute to restrict the heuristics to classes to which this is applicable. For compatibility, the attribute is only honored in shiboken 6 if some class in the type system explicitly specifies it. For shiboken 7, it will be mandatory. [ChangeLog][shiboken6] An type system attribute for restricting the parent ownership heuristics to relevant classes has been introduced. The workaround 0e62c4db50472f8b581022c86a6be651158d0cd0 can then be reverted. Task-number: PYSIDE-1939 Change-Id: I0fb01e9842aecbccaa686ce71b2163b20a97cbf7 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h
index c8dbb8b8d..d17bc5c80 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h
@@ -113,6 +113,10 @@ public:
bool isImplicitlyCopyConstructible() const;
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; }
+
bool generateExceptionHandling() const;
CppWrapper cppWrapper() const;