[C++-sig] ownership of C++ object extended in Python

Mark Williams mark at image-engine.com
Mon Mar 19 23:21:48 CET 2007


>     virtual ~event_t_wrapper(){
>         if (this->m_pyobj) {
>             //Py_DECREF(this->m_pyobj);
>             this->m_pyobj = 0;
>         }
>     }
> 

Many thanks for the solution - it appears to be working just fine. 
However I'm wondering why the Py_DECREF line above is commented out?

Thanks again,
Mark



More information about the Cplusplus-sig mailing list