Closed GoogleCodeExporter closed 9 years ago
I would bet that the problem is this code:
returnPyObj = Py_BuildValue("N", PyUnicode_AsUTF8String(
PyUnicode_FromWideChar(currentDirectoryContent,
currentDirectory.Length / 2)
)
);
It's creating a Python object and then since we're not keeping the handle to the
object, we can't decrement the reference count, and we end up with a leaked
object.
For an example of what I did in the get_arg_list() code:
for( i=0; i<nArgs; i++) {
arg_from_wchar = PyUnicode_FromWideChar(szArglist[i],
wcslen(szArglist[i])
);
arg = PyUnicode_AsUTF8String(arg_from_wchar);
Py_XDECREF(arg_from_wchar);
PyList_Append(argList, arg);
Py_XDECREF(arg);
}
}
We probably need to create explicit Python objects so we can store and then
decrement
the reference when we're done with it.
Original comment by jlo...@gmail.com
on 4 Sep 2009 at 3:52
Fixed in r428
Original comment by jlo...@gmail.com
on 4 Sep 2009 at 4:33
Original comment by billiej...@gmail.com
on 17 Sep 2009 at 8:57
[deleted comment]
Updated csets after the SVN -> Mercurial migration:
r428 == revision d22ed65c83a6
Original comment by g.rodola
on 2 Mar 2013 at 11:50
Original issue reported on code.google.com by
billiej...@gmail.com
on 3 Sep 2009 at 7:53