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>2006-07-03 09:27:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-07-03 09:27:29 +0400
commitda83509dca485b893aa76511d03a7e3aa8ff8a1f (patch)
tree1eceef3ff4e8e3875645987ee39dfa6b58a6ec0b /source/blender/python
parenta33feaf49bf865aa6de0a02fd2b4231bb0393757 (diff)
fixed an error in DECREF'ing a variable that could have been null, also gave more helpfull error messages, thanks Theeth
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/api2_2x/Geometry.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c
index 7d6ba48ca35..df33d90a3c1 100644
--- a/source/blender/python/api2_2x/Geometry.c
+++ b/source/blender/python/api2_2x/Geometry.c
@@ -91,21 +91,20 @@ PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * args )
for( i = 0; i < len_polylines; ++i ) {
polyLine= PySequence_GetItem( polyLineSeq, i );
- if (!PySequence_Check(polyLineSeq)) {
+ if (!PySequence_Check(polyLine)) {
freedisplist(&dispbase);
- Py_DECREF(polyLine);
+ Py_XDECREF(polyLine); /* may be null so use Py_XDECREF*/
return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of poly lines" );
+ "One or more of the polylines is not a sequence of Mathutils.Vector's" );
}
-
len_polypoints= PySequence_Size( polyLine );
if (len_polypoints>0) { /* dont bother adding edges as polylines */
if (EXPP_check_sequence_consistency( polyLine, &vector_Type ) != 1) {
freedisplist(&dispbase);
Py_DECREF(polyLine);
return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of poly lines" );
+ "A point in one of the polylines is not a Mathutils.Vector type" );
}
dl= MEM_callocN(sizeof(DispList), "poly disp");
@@ -147,7 +146,7 @@ PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * args )
if( !tri_list ) {
freedisplist(&dispbase);
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
+ "Geometry.PolyFill failed to make a new list" );
}
index= 0;