From aa05370dce61c9223d67c0684b26db3c7258562a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 27 Aug 2014 16:48:43 +0200 Subject: [PATCH] Remove wrong decrementation of refcount in the event callbacks of the Python wrapper. --- tools/python/apixml2python/linphone.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/python/apixml2python/linphone.py b/tools/python/apixml2python/linphone.py index 1b4fc7f91..b3ae811fc 100644 --- a/tools/python/apixml2python/linphone.py +++ b/tools/python/apixml2python/linphone.py @@ -719,7 +719,6 @@ class EventCallbackMethodDefinition(MethodDefinition): def format_c_function_call(self): create_python_objects_code = '' - decref_python_objects_code = '' fmt = 'O' args = ['pylc'] for xml_method_arg in self.xml_method_args: @@ -746,7 +745,6 @@ class EventCallbackMethodDefinition(MethodDefinition): {new_from_native_pointer_code} }} """.format(name=arg_name, get_user_data_code=get_user_data_code, new_from_native_pointer_code=new_from_native_pointer_code) - decref_python_objects_code += "\t\tPy_DECREF(py{name});\n".format(name=arg_name) args=', '.join(args) return \ """ if ((func != NULL) && PyCallable_Check(func)) {{ @@ -754,9 +752,8 @@ class EventCallbackMethodDefinition(MethodDefinition): if (PyEval_CallObject(func, Py_BuildValue("{fmt}", {args})) == NULL) {{ PyErr_Print(); }} -{decref_python_objects_code} }} -""".format(fmt=fmt.replace('O', 'N'), args=args, create_python_objects_code=create_python_objects_code, decref_python_objects_code=decref_python_objects_code) +""".format(fmt=fmt.replace('O', 'N'), args=args, create_python_objects_code=create_python_objects_code) def format_return_trace(self): return "\tpylinphone_trace(-1, \"[PYLINPHONE] <<< %s\", __FUNCTION__);\n"