Egil Moeller wrote:
I've written a C-module for Python, and it works as intended, but
obviously does something wrong with its memmory management (refference
counting), as it causes Python to segfault now and then (randomly,
whey :S)

You can atry to use the Python function sys.getrefcount. Print the refcount of the parameter values before and after your extension gets called and print the refcount of the return value (s). I once forgot to increment the refcount of the None object which was put into the return tuple.


If you pass a list as a parameter, you should also print the refcounts of the list elements etc.

Daniel Dittmar
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to