diff options
| author | Christian Tismer <tismer@stackless.com> | 2022-09-11 11:19:20 +0200 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2022-09-12 09:52:56 +0200 |
| commit | ace680f4c5fc8564df9daaa41bf8779c9fffa671 (patch) | |
| tree | b3f9e91a67c2b46c1961fcc49565d1ba128451f0 /sources/pyside6 | |
| parent | 0b476f83248565d10982b3400d06fa4df5690354 (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
Pick-to: 6.2 6.3 5.15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6')
| -rw-r--r-- | sources/pyside6/libpyside/pysideproperty.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/pysideproperty.cpp b/sources/pyside6/libpyside/pysideproperty.cpp index 22bfa7f30..a4f90b8fd 100644 --- a/sources/pyside6/libpyside/pysideproperty.cpp +++ b/sources/pyside6/libpyside/pysideproperty.cpp @@ -67,6 +67,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} }; @@ -235,6 +236,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); } |
