I am creating CFUNCTYPE objects in my script and passing them as callbacks to c.
If I make them local they are destroyed immediately and I am getting access violaton errors
Tried to gc.disable(), it doesnt help.
Today Im making global lists and putting/removing FUNCTYPE objects when needed.
Is there better solution?
I am creating CFUNCTYPE objects in my script and passing them as callbacks to
Share
The easiest way is to attach the CFUNCTYPE objects to a module or class. I’ve found it useful to have a Python wrapper module – in essence a separate file that keeps everything at the ctypes level in one namespace.
You could add and remove your callbacks from there as necessary.