diff options
author | Andreas Beckermann <beckermann@monument-software.de> | 2019-10-17 08:49:52 +0200 |
---|---|---|
committer | Andreas Beckermann <beckermann@monument-software.de> | 2019-10-25 09:43:53 +0200 |
commit | e940872c12399e8fc5c33ed2e52a719373bc03cf (patch) | |
tree | 775977a15a7f4807c972ecdc40fc94806c45eae3 /sources/shiboken2/ApiExtractor/tests/testdtorinformation.h | |
parent | 28fa0a6baba7a79ce85f8d62c2c296aa9f98de4c (diff) |
Fix hasVirtualDestructor() for implicit destructors
If a derived class does not declare an explicit destructor,
AbstractMetaClass::hasVirtualDestructor() is set to false.
However this is incorrect for classes that have a base class that in
turn provide a virtual destructor.
Consequently shiboken generates incorrect code in cases where it depends
on that value (e.g. for methods that override ownership of the returned
object - instead of releasing ownership, shiboken invalidates it).
This patch considers the baseClass()->hasVirtualDestructor() after
traversing all functions (which checks for explicit destructors).
Change-Id: Ifc4a472290d835dd6ef7d702b912643c9a2b42da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/tests/testdtorinformation.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testdtorinformation.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testdtorinformation.h b/sources/shiboken2/ApiExtractor/tests/testdtorinformation.h index 068ef4952..0a57dd8d1 100644 --- a/sources/shiboken2/ApiExtractor/tests/testdtorinformation.h +++ b/sources/shiboken2/ApiExtractor/tests/testdtorinformation.h @@ -40,6 +40,7 @@ private slots: void testDtorIsPrivate(); void testDtorIsProtected(); void testDtorIsVirtual(); + void testDtorFromBaseIsVirtual(); void testClassWithVirtualDtorIsPolymorphic(); }; |