[Pyrex] Re: callback working, but memory leak?

Bryan Weingarten bryan.weingarten at pobox.com
Sat Aug 23 15:51:01 CEST 2003


hi,

i believe i've taken care of my memory leak issue and i'm using duncan's
booth's suggestion of setting self.callback  i'm also setting it to None
which causes a decrement.   i'm not sure why it wasn't working before when i
tried this before.  i tried it with Py_INC/DECREF and it work too.

   def __del__(self):
        self.callback = None

   def status_callback(self, callback):
        self.callback = callback
        set_status_callback(self.ctx, _callback_wrapper, <void*>callback)

cdef int _callback_wrapper(void *callback, long sec, long msec) except 0:
    return (<object>callback)(sec, msec)


thanks for your suggestions,

bryan






More information about the Pyrex mailing list