diff options
author | Joilnen Leite <joilnen.leite@gmail.com> | 2005-05-19 03:53:00 +0400 |
---|---|---|
committer | Joilnen Leite <joilnen.leite@gmail.com> | 2005-05-19 03:53:00 +0400 |
commit | 35ee2c2b4e6345ba3887bacf7f3bff24b12789fd (patch) | |
tree | 71fa6b24be5c4b7c166fcb3072ac7f730c0094e1 | |
parent | 803d440871f79a9f19cffc71e0f570d677db78c2 (diff) |
fix a little mem leak
.
-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; |