diff options
Diffstat (limited to 'sources/shiboken2/libshiboken/pep384impl_doc.rst')
-rw-r--r-- | sources/shiboken2/libshiboken/pep384impl_doc.rst | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sources/shiboken2/libshiboken/pep384impl_doc.rst b/sources/shiboken2/libshiboken/pep384impl_doc.rst index 9974f737b..2844249ad 100644 --- a/sources/shiboken2/libshiboken/pep384impl_doc.rst +++ b/sources/shiboken2/libshiboken/pep384impl_doc.rst @@ -426,11 +426,16 @@ many headaches:: type->tp_dealloc = subtype_dealloc; } -So, if you think you have no ``tp_dealloc`` field set, you will unwantedly -get ``subtype_dealloc``, which in the case of PySide always was wrong! +In fact, before the move to the new API, the ``PyType_Ready`` function +filled empty ``tp_dealloc`` fields with ``object_dealloc``. And the code +that has been written with that in mind now becomes pretty wrong if suddenly +``subtype_dealloc`` is used. + +The way out was to explicitly provide an ``object_dealloc`` function. +This would then again impose a problem, because ``object_dealloc`` is not +public. Writing our own version is easy, but it again needs access to +type objects. But fortunately, we have broken this rule, already... -The way out was to use a dummy function that has no effect other than -being something not NULL. * The new types are only partially allocated |