plugins: python renderer: Dereference function after calling

This commit is contained in:
Mario Hüttel 2019-11-17 01:13:49 +01:00
parent 112a5ac74c
commit 045b9dce30

View File

@ -44,7 +44,7 @@ int FUNC_DECL(EXTERNAL_LIBRARY_RENDER_FUNCTION)(struct gds_cell *toplevel, GList
if (PyErr_Occurred()) if (PyErr_Occurred())
PyErr_Print(); PyErr_Print();
else else
fprintf(stderr, "function not found in python module\n"); fprintf(stderr, "Function not found in python module\n");
ret = -1; ret = -1;
goto return_value; 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_DECREF(p_return_value);
} }
Py_XDECREF(p_render_func);
return_value: return_value:
return ret; return ret;
} }
@ -111,6 +113,7 @@ int FUNC_DECL(EXTERNAL_LIBRARY_FINALIZE_FUNCTION)(void)
if (p_module) if (p_module)
Py_DECREF(p_module); Py_DECREF(p_module);
ret = Py_FinalizeEx(); ret = Py_FinalizeEx();
return ret; return ret;
} }