1cdef class A: 2 """ 3 >>> A().test(3) 4 9 5 """ 6 7 cdef int (*func_ptr)(int) 8 9 def __init__(self): 10 self.func_ptr = &func 11 12 cdef int do_it(self, int s): 13 cdef int r = first_call(self).func_ptr(s) # the temp for first_call(self) not properly freed 14 return r 15 16 def test(self, s): 17 return self.do_it(s) 18 19cdef A first_call(A x): 20 return x 21 22cdef int func(int s): 23 return s*s 24