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>2007-06-12 09:17:35 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-06-12 09:17:35 +0400
commit82eab51a29b1286146f3befb85d3d792b20ff8cc (patch)
treea2d6bc32fedd389f38bbb3852d0b494c46bc869c /source/blender/python/api2_2x/gen_utils.c
parent12d32f5cf95591197c0883a73e1b3cc6da1bca4b (diff)
fix own error - EXPP_getScriptLinks, was returning an unset list.
Diffstat (limited to 'source/blender/python/api2_2x/gen_utils.c')
-rw-r--r--source/blender/python/api2_2x/gen_utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c
index c38e9daeb3f..b60a699fe47 100644
--- a/source/blender/python/api2_2x/gen_utils.c
+++ b/source/blender/python/api2_2x/gen_utils.c
@@ -394,16 +394,16 @@ PyObject *EXPP_getScriptLinks( ScriptLink * slink, PyObject * args,
if( !PyArg_ParseTuple( args, "s", &eventname ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected event name (string) as argument" );
-
- /* actually !scriptlink shouldn't happen ... */
- if( !slink || !slink->totscript )
- return list;
list = PyList_New( 0 );
if( !list )
return EXPP_ReturnPyObjError( PyExc_MemoryError,
"couldn't create PyList!" );
+ /* actually !scriptlink shouldn't happen ... */
+ if( !slink || !slink->totscript )
+ return list;
+
if( !strcmp( eventname, "FrameChanged" ) )
event = SCRIPT_FRAMECHANGED;
else if( !strcmp( eventname, "Redraw" ) )
@@ -415,7 +415,7 @@ PyObject *EXPP_getScriptLinks( ScriptLink * slink, PyObject * args,
else if( is_scene && !strcmp( eventname, "OnSave" ) )
event = SCRIPT_ONSAVE;
else {
- Py_XDECREF(list);
+ Py_DECREF(list);
return EXPP_ReturnPyObjError( PyExc_AttributeError,
"invalid event name" );
}