On Thursday 22 January 2009 05:51:20 Sebastian Walter wrote: > In my above case I know that *x won't be deleted because it is global, > right?
*x is not deleted since you used PyArray_SimpleNewFromData; that *x is a global is irrelevant here. > Why exactly does the > *** glibc detected *** python: malloc(): memory corruption (fast): > 0x0817b6a1 *** > occur then? In the code you posted this time, incref() is required so that someone owns a reference to the array object. What I don't know off the top of my head is whether you need an incref in the constructor of A and a decref in the destructor of A. > And is there a way to get the refcount of an object within Python? I'd > like to test if the refcount is correct. sys.getrefcount(obj) Regards, Ravi _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig