From 045b9dce304eca027ac14f4f60012b2902166ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sun, 17 Nov 2019 01:13:49 +0100 Subject: [PATCH] plugins: python renderer: Dereference function after calling --- plugins/python-renderer/src/plugin-main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/python-renderer/src/plugin-main.c b/plugins/python-renderer/src/plugin-main.c index a522f17..e119aa6 100644 --- a/plugins/python-renderer/src/plugin-main.c +++ b/plugins/python-renderer/src/plugin-main.c @@ -44,7 +44,7 @@ int FUNC_DECL(EXTERNAL_LIBRARY_RENDER_FUNCTION)(struct gds_cell *toplevel, GList if (PyErr_Occurred()) PyErr_Print(); else - fprintf(stderr, "function not found in python module\n"); + fprintf(stderr, "Function not found in python module\n"); ret = -1; goto return_value; @@ -56,6 +56,8 @@ int FUNC_DECL(EXTERNAL_LIBRARY_RENDER_FUNCTION)(struct gds_cell *toplevel, GList Py_DECREF(p_return_value); } + Py_XDECREF(p_render_func); + return_value: return ret; } @@ -111,6 +113,7 @@ int FUNC_DECL(EXTERNAL_LIBRARY_FINALIZE_FUNCTION)(void) if (p_module) Py_DECREF(p_module); + ret = Py_FinalizeEx(); return ret; }