[Pyrex] Function Pointer

Greg Ewing greg at cosc.canterbury.ac.nz
Fri Mar 5 00:41:44 CET 2004


Marco Bubke <marco at bubke.de>:

> cdef void tesselator_vertex(object vertex, object tesselator):
>   print "vertex: ", vertex._indice
>
>   ...
> 
>     gluTessCallback(self._tesselator, GLU_TESS_VERTEX_DATA, 
> 	<void(*)()>&tesselator_vertex)

Are you sure that the arguments getting passed through to
your callback are really Python objects (PyObject * in
C terms)? If not, bad things could happen before the body
of the callback is reached, even if the arguments aren't
used anywhere in the body.

Try using pure C functions as callbacks, with no Python
arguments. That will tell you whether the callback is
getting called at all.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+





More information about the Pyrex mailing list