[C++-sig] class callback

Nicodemus nicodemus at esss.com.br
Sun Jan 25 15:48:09 CET 2004


Leo Yee wrote:

>Hi,
>
>I am coding c++ object which gives callback functions to python. I
>encountered these problem that a c++ object destruction method won't be
>called if a python class holds the c++ object that has a callback function
>of this python class.
>
>Let's look the code.
>
><snip>
>  
>


Perhaps this recipe can help you: 
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81253

But I don't understand why did you expect the _cHolder object to be 
destroyed, since a reference to it is still held in the a object...

Regards,
Nicodemus.





More information about the Cplusplus-sig mailing list