Alexis Marrero wrote:
> I forgot to mentioned that I changed request_tp_dealloc to:
> static void request_tp_dealloc(requestobject *self)
> {    // de-register the object from the GC
>    // before its deallocation, to prevent the
>    // GC to run on a partially de-allocated object
>    if (self->rbuff != NULL) {
>        free(self->rbuff);
>    }
>    PyObject_GC_UnTrack(self);
>      request_tp_clear(self);
> 
>    PyObject_GC_Del(self);
> }
> 
> I don't know if that function will be the right place to
> free(self->rbuff) but it for the mean time there is no leak in my test.

Somehow that doesn't feel like the right spot, but I'm not sure either.

Jim




Reply via email to