From baddfc066bb02a31792442b00292ec38cd934eab Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 8 Sep 2014 09:18:20 +0200 Subject: [PATCH] Always increment python object references before calling event callback. --- tools/python/apixml2python/linphone.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/python/apixml2python/linphone.py b/tools/python/apixml2python/linphone.py index 5c22e63c9..0825d8d62 100644 --- a/tools/python/apixml2python/linphone.py +++ b/tools/python/apixml2python/linphone.py @@ -770,9 +770,8 @@ class EventCallbackMethodDefinition(MethodDefinition): """ {get_user_data_code} if (py{name} == NULL) {{ {new_from_native_pointer_code} - }} else {{ - Py_INCREF(py{name}); }} + Py_INCREF(py{name}); """.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)