Robert Steckroth
2012-12-05 19:14:43 UTC
In the below example, is there an extra reference to the align object when
the Py_RETURN_NONE IS hit? Also, why do I have to Py_INCREF(s_obj)? If I do
not, I end up with crashes. Is this a bug?
PyObject *s_obj=NULL, *align=NULL;
if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist, &s_obj,
&align) )
return NULL;
if ( s_obj ) Py_XINCREF(s_obj);
if ( align ) { Py_XINCREF(align);
PyObject_SetAttrString(s_obj, "align", align); }
Py_RETURN_NONE; }
the Py_RETURN_NONE IS hit? Also, why do I have to Py_INCREF(s_obj)? If I do
not, I end up with crashes. Is this a bug?
PyObject *s_obj=NULL, *align=NULL;
if ( ! PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist, &s_obj,
&align) )
return NULL;
if ( s_obj ) Py_XINCREF(s_obj);
if ( align ) { Py_XINCREF(align);
PyObject_SetAttrString(s_obj, "align", align); }
Py_RETURN_NONE; }
--
Bust0ut, Surgemcgee: Systems Engineer ---
surgemcgee.com
Django_Teamplate3d
Bust0ut, Surgemcgee: Systems Engineer ---
surgemcgee.com
Django_Teamplate3d