ctypes: pointer to method

Martin Landa landa.martin at gmail.com
Fri Aug 6 16:18:37 EDT 2010


Hi,

On Aug 6, 10:10 pm, Martin Landa <landa.mar... at gmail.com> wrote:

> Any idea how to solve it. Thanks, Martin

I overlooked note

"""
Make sure you keep references to CFUNCTYPE objects as long as they are
used from C code. ctypes doesn’t, and if you don’t, they may be
garbage collected, crashing your program when a callback is made.
"""

If I defined errtype and errfunc as global variable everything works.
Thanks again for your help. Martin



More information about the Python-list mailing list