Problem embedding in small Win32 App

Brad Johnson Brad.Johnson at ballardtech.com
Fri Jul 27 17:56:47 EDT 2007


Gabriel Genellina <gagsl-py2 <at> yahoo.com.ar> writes:

> 
> By far, the most common problem extending/embedding Python is to do wrong  
> reference counts.
> Read http://docs.python.org/ext/refcounts.html again (I hope you already  
> did!) and make sure you don't hold a pointer to an object without  
> incrementing its reference count, by example.
> If you can shrink your application to the minimum code that shows the  
> problem, try posting it here.
> 

Thanks for the advice! Adding the requisite Py_INCREFs has fixed my problem.
Please forgive my ignorance in forgetting this basic piece of information. I did
read the section you provided, and rereading it reminded me that I was only
doing one half of the equation with Py_DECREF.




More information about the Python-list mailing list