diff options
Diffstat (limited to 'source/blender/python/api2_2x/Font.c')
-rw-r--r-- | source/blender/python/api2_2x/Font.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Font.c b/source/blender/python/api2_2x/Font.c index 5e432a7086d..865285f1e42 100644 --- a/source/blender/python/api2_2x/Font.c +++ b/source/blender/python/api2_2x/Font.c @@ -202,14 +202,18 @@ PyObject *M_Font_New( PyObject * self, PyObject * args ) char *name_str = "<builtin>"; char *parent_str = ""; BPy_Font *py_font = NULL; /* for Font Data object wrapper in Python */ + PyObject *tmp; if( !PyArg_ParseTuple( args, "|s", &name_str ) ) return ( EXPP_ReturnPyObjError( PyExc_AttributeError, "expected string or empty argument" ) ); /*create python font*/ - if( !S_ISDIR(BLI_exist(name_str)) ) + if( !S_ISDIR(BLI_exist(name_str)) ) { + tmp= Py_BuildValue("(s)", name_str); py_font= M_Text3d_LoadFont (self, Py_BuildValue("(s)", name_str)); + Py_DECREF (tmp); + } else return EXPP_incr_ret( Py_None ); return ( PyObject * ) py_font; |