aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2022-09-11 11:19:20 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-12 09:43:17 +0000
commit1dd083b961a57f3e688b9b6bedc995e3f52ca921 (patch)
tree71b55b80ea3b357821fc98ea1fa63b3d41a92dee
parent7fe9b97640a30b2e46342033e752e4602c0512fa (diff)
Fix Property GC tracking for Python 3.11
The GC was not untracked when PySide Property was deleted. This was found by the new deeper error tracking in debug Python 3.11 . Fixes: PYSIDE-1960 Change-Id: I5ecdfb88529c22a44575ca9460d6753b1e389079 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ace680f4c5fc8564df9daaa41bf8779c9fffa671) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/pyside6/libpyside/pysideproperty.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/pysideproperty.cpp b/sources/pyside6/libpyside/pysideproperty.cpp
index 5e68253d8..b9f788b61 100644
--- a/sources/pyside6/libpyside/pysideproperty.cpp
+++ b/sources/pyside6/libpyside/pysideproperty.cpp
@@ -103,6 +103,7 @@ static PyType_Slot PySidePropertyType_slots[] = {
{Py_tp_init, reinterpret_cast<void *>(qpropertyTpInit)},
{Py_tp_new, reinterpret_cast<void *>(qpropertyTpNew)},
{Py_tp_getset, PySidePropertyType_getset},
+ {Py_tp_del, reinterpret_cast<void *>(PyObject_GC_Del)},
{0, nullptr}
};
@@ -271,6 +272,7 @@ static void qpropertyDeAlloc(PyObject *self)
// This was not needed before Python 3.8 (Python issue 35810)
Py_DECREF(Py_TYPE(self));
}
+ PyObject_GC_UnTrack(self);
Py_TYPE(self)->tp_free(self);
}