fix for 2 python refcounting errors

This commit is contained in:
2008-09-03 23:51:55 +00:00
parent 19d5a5da45
commit 961a26d500
2 changed files with 8 additions and 9 deletions

View File

@@ -274,7 +274,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
{
char cpath[sizeof(G.sce)];
char *searchpath = NULL;
PyObject* list;
PyObject* list, *value;
DIR *dp;
struct dirent *dirp;
@@ -300,7 +300,9 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
while ((dirp = readdir(dp)) != NULL) {
if (BLI_testextensie(dirp->d_name, ".blend")) {
PyList_Append(list, PyString_FromString(dirp->d_name));
value = PyString_FromString(dirp->d_name);
PyList_Append(list, value);
Py_DECREF(value);
}
}