Re: Python C Extensions

2011-02-24 Thread MRAB
On 24/02/2011 16:46, aken8...@yahoo.com wrote: Thank you very much, it worked. I thought the PyDict_SetItem should assume ownership of the passed object and decrease it's reference count (I do not know why). Does this also go for the Lists ? Should anything inserted into list also be DECRED-ed ?

Re: Python C Extensions

2011-02-24 Thread Carl Banks
On Feb 24, 8:46 am, "aken8...@yahoo.com" wrote: > Thank you very much, it worked. > I thought the PyDict_SetItem should assume ownership > of the passed object and decrease it's reference count (I do not know > why). > > Does this also go for the Lists ? Should anything inserted into list > also >

Re: Python C Extensions

2011-02-24 Thread aken8...@yahoo.com
Thank you very much, it worked. I thought the PyDict_SetItem should assume ownership of the passed object and decrease it's reference count (I do not know why). Does this also go for the Lists ? Should anything inserted into list also be DECRED-ed ? Thank you again for reply. On Feb 24, 11:33 am

Re: Python C Extensions

2011-02-24 Thread MRAB
On 24/02/2011 16:01, aken8...@yahoo.com wrote: Hi, I have a memory leak problem with my "C" extension module. My C module returns large dictionaries to python, and the dictionaries never get deleted, so the memory for my program keeps growing. I do not know how to delete the dictionary object a