Re: [Ctypes-devel] Crash using callback
Brought to you by:
theller
From: Peter H. <pe...@en...> - 2006-10-05 17:23:59
|
Victor Stinner wrote: > Question: would it be possible to change object lifetime, tell that the > function keep a referrence of the object, or something like that? Or should I > keep a copy of "mycallback = callback_t(mine)" somewhere? I'm pretty sure you must keep a reference in Python, or it will be (via reference counting) freed up immediately. I'm also (slightly less, but still fairly) sure that the documentation on callbacks points something like this out... maybe double-check there again? -Peter |