[Cython] Object not released when calling cpdef method from inherited class ?
Guillaume Chereau
charlie at openmoko.org
Fri Jul 18 10:27:41 CEST 2008
Ah excellent !
Thanks a lot !
-Charlie
On Fri, 2008-07-18 at 00:28 -0700, Robert Bradshaw wrote:
> Fixed, see http://trac.cython.org/cython_trac/ticket/24
>
> On Jul 7, 2008, at 8:37 PM, Guillaume Chereau wrote:
>
> > Hello all,
> >
> > I am currently using cython for a project related to openmoko cell
> > phone : http://charlie137-2.blogspot.com/2008/07/introducing-
> > tichy.html
> >
> > I noticed that the memory is constantly increasing when I use
> > cython. I
> > tracked down the problem to the case where I create a subclass of a
> > cython class and then redefine a cpdef method, asking it to call the
> > parent method, but ONLY if the cpdef method then call an other cpdef
> > method !
> >
> > Here is the smallest example I could come with that fails :
> >
> >
> > == test.pyx ==
> >
> > cdef class A:
> > cpdef func(self):
> > return
> >
> > cpdef test(self):
> > self.func()
> >
> >
> > == main.py ==
> >
> > import test
> > import gc
> >
> > class B(test.A):
> > def test(self):
> > test.A.test(self)
> >
> > b = B()
> >
> > for i in range(10):
> > b.test()
> > gc.collect()
> > print len(gc.get_objects())
> >
> >
> > The output will show that some objects are not released.
> >
> > Is it a known bug ? Is there a way to avoid it ?
> >
> > I tried with both Cython 0.9.6 and Cython 0.9.8
> >
> > cheers,
> > -Charlie
> > _______________________________________________
> > Cython-dev mailing list
> > Cython-dev at codespeak.net
> > http://codespeak.net/mailman/listinfo/cython-dev
>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://codespeak.net/pipermail/cython-dev/attachments/20080718/2578dbdc/attachment.pgp
More information about the Cython-dev
mailing list