diff options
author | Christian Tismer <tismer@stackless.com> | 2018-07-10 12:27:15 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2018-07-10 15:28:33 +0000 |
commit | 5829cbbf60529448e63e5b7103a007d08d9387d8 (patch) | |
tree | e7c38c04384ce3f1163172878d83a32f1b5bfb8a /sources/shiboken2/libshiboken/sbkenum.cpp | |
parent | 264e0ec580dcca0366aa0e79da11cf38893c4a2f (diff) |
Fix limited API incompatibility with Python 3.7
When Python 3.7 appeared, the structure of pystate.h was changed,
substantially. Unfortunately this structure contains the trashcan
code, which is only available as a macro and not part of the limited API.
This code is normally not used by application programs.
It prevents crashes when chains of millions of objects are deallocated.
I disabled this for now when the limited API is active.
As soon as somebody complains about crashes, I will try to implement
it again in a safe way, but I am not sure if it is worth it in the first place.
Task-number: PYSIDE-737
Change-Id: Id0daf391448ddcb9df3d299f859ef024714fa736
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkenum.cpp')
-rw-r--r-- | sources/shiboken2/libshiboken/sbkenum.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/sbkenum.cpp b/sources/shiboken2/libshiboken/sbkenum.cpp index 5f753293c..119591215 100644 --- a/sources/shiboken2/libshiboken/sbkenum.cpp +++ b/sources/shiboken2/libshiboken/sbkenum.cpp @@ -312,11 +312,15 @@ void SbkEnumTypeDealloc(PyObject* pyObj) SbkEnumType* sbkType = reinterpret_cast<SbkEnumType*>(pyObj); PyObject_GC_UnTrack(pyObj); +#ifndef Py_LIMITED_API Py_TRASHCAN_SAFE_BEGIN(pyObj); +#endif if (PepType_SETP(sbkType)->converter) { Shiboken::Conversions::deleteConverter(PepType_SETP(sbkType)->converter); } +#ifndef Py_LIMITED_API Py_TRASHCAN_SAFE_END(pyObj); +#endif } PyObject* SbkEnumTypeTpNew(PyTypeObject* metatype, PyObject* args, PyObject* kwds) |