diff --git a/tools/python/apixml2python/handwritten.mustache b/tools/python/apixml2python/handwritten.mustache index 69f73533b..6971b7cb6 100644 --- a/tools/python/apixml2python/handwritten.mustache +++ b/tools/python/apixml2python/handwritten.mustache @@ -92,6 +92,7 @@ static PyObject * pylinphone_module_method_set_log_handler(PyObject *self, PyObj if (linphone_module != NULL) { Py_INCREF(callback); PyObject_SetAttrString(linphone_module, "__log_handler", callback); + Py_DECREF(linphone_module); } Py_RETURN_NONE; }