[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Functions that steal references (Re: [pygame] [patch] minor memory leaks...)



Lenard Lindstrom wrote:

What a function that steals a reference does with an error is undocumented. PyModule_AddObject only steals a referenece when it succeeds. PyList_SetItem and PyTuple_SetItem always steals a reference. The only way to find out which is the case is to examine the Python source code.

Well, that's pretty unsatisfactory. The refcounting
behaviour on failure is just as important as any
other part of the function's spec, and needs to
be documented somewhere.

--
Greg