On 10/04/2010 10:46 AM, Jonas H. wrote:
On 10/03/2010 11:52 PM, Antoine Pitrou wrote:
You probably have a problem in your tp_dealloc implementation.

`tp_dealloc` is NULL...

Alright, `tp_dealloc` must not be NULL because it's called by `_Py_Dealloc`. The C-API tutorial is quite confusing here:

[...] here's a minimal, but __complete__, module that defines a new type:

[...]
static PyTypeObject noddy_NoddyType = {
    [...]
    0,                         /*tp_dealloc*/
    [...]
};

So I thought "complete" meant "it works". Actually, DECREFing that an object of *that* type does not work, it crashes because of the NULL `tp_dealloc` function pointer that is called in `_Py_Dealloc`.

Jonas
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to