Added Py_DECREF since PySequence_GetItem adds a reference where as PyTuple_GetItem borrows it.

Thank ken.
This commit is contained in:
Campbell Barton 2006-06-06 17:28:39 +00:00
parent 46329e5ab0
commit 721de110b2

@ -4135,8 +4135,9 @@ static int MFace_setUVSel( BPy_MFace * self, PyObject * value )
face = &self->mesh->tface[self->index];
mask = TF_SEL1;
for( i=0; i<length; ++i, mask <<= 1 ) {
PyObject *tmp = PySequence_GetItem( value, i );
PyObject *tmp = PySequence_GetItem( value, i ); /* adds a reference, remove below */
if( !PyInt_CheckExact( tmp ) ) {
Py_DECREF(tmp);
return EXPP_ReturnIntError( PyExc_TypeError,
"expected a tuple of integers" );
}
@ -4144,6 +4145,7 @@ static int MFace_setUVSel( BPy_MFace * self, PyObject * value )
face->flag |= mask;
else
face->flag &= ~mask;
Py_DECREF(tmp);
}
return 0;
}