[Jeremy Moles]
> When I add an object created locally to a mapping or sequence (that will
> be returned from a function into an running instance of the Python
> interpreter), I need to call Py_DECREF on the object, right?
It depends on the the function or macro, but usually the answer is Yes.
The
Jeremy Moles wrote:
> When I add an object created locally to a mapping or sequence ...
> I need to call Py_DECREF on the object, right? ... for example:
> PyObject* list = Py_Buildvalue("[]");
> ...
> PyObject* num = Py_BuildValue("i", 10);
> PyList_Append(list, num);
> ..
When I add an object created locally to a mapping or sequence (that will
be returned from a function into an running instance of the Python
interpreter), I need to call Py_DECREF on the object, right?
Unfortunately, I really feel like the following code leaks memory...
--- for example ---
PyObjec