aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-01-30 19:04:01 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-28 13:59:32 +0200
commit4ca5aefe4f6e05eba4d73a93620134e37ac5f1d6 (patch)
tree17374bd504c7fc5ac9d693e981c78671c20b8cac /sources
parentbd4180ffdd47d423b0bd2b995b09df474b8c5a81 (diff)
shiboken: Provide the correct inheritance for enum types, Fix
This patch adds a missing Py_INCREF on the base class `Shiboken.Enum` when a new type is created. This is _not_ automatically provided (but it _is_ for the meta type...). The error was visible in a debug build, only. Change-Id: I213713535acd1dde71bd8e3a0efe6122119d43b5 Fixes: PYSIDE-1487 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ddb03b40f311a9c34b599136ac1cb0324f6b2b42) Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken2/libshiboken/sbkenum.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/sbkenum.cpp b/sources/shiboken2/libshiboken/sbkenum.cpp
index 35f883c55..64b0edf89 100644
--- a/sources/shiboken2/libshiboken/sbkenum.cpp
+++ b/sources/shiboken2/libshiboken/sbkenum.cpp
@@ -732,6 +732,7 @@ newTypeWithName(const char *name,
newspec.slots = newslots;
Shiboken::AutoDecRef bases(PyTuple_New(1));
static auto basetype = SbkEnum_TypeF();
+ Py_INCREF(basetype);
PyTuple_SetItem(bases, 0, reinterpret_cast<PyObject *>(basetype));
auto *type = reinterpret_cast<PyTypeObject *>(SbkType_FromSpecWithBases(&newspec, bases));
PyErr_Print();