Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-09-04 03:51:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-09-04 03:51:55 +0400
commit961a26d50058de81ca27a9465320c0177e5eeeb4 (patch)
treea7e1857dd8fb463332c15bbf54ce0b0f92813906 /source/gameengine/Ketsji/KX_PythonInit.cpp
parent19d5a5da452bf5d07bc9409577141401c1e2e0be (diff)
fix for 2 python refcounting errors
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index e9fb0278d76..4b6a38f18c0 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -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);
}
}