From 35ee2c2b4e6345ba3887bacf7f3bff24b12789fd Mon Sep 17 00:00:00 2001 From: Joilnen Leite Date: Wed, 18 May 2005 23:53:00 +0000 Subject: fix a little mem leak . --- source/blender/python/api2_2x/Font.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/python') 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 = ""; 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; -- cgit v1.2.3