From: Sven Trenkel Date: Mon, 15 Aug 2016 18:51:25 +0000 (+0000) Subject: python plugin: Grab GIL before freeing callbacks. If their refcount reaches 0 Python... X-Git-Tag: collectd-5.6.0~12^2~2 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=240b01025dcf6b38ccf451fbd95b3c6698853268 python plugin: Grab GIL before freeing callbacks. If their refcount reaches 0 Python code will be executed. --- diff --git a/src/python.c b/src/python.c index 05a44aa8..a682f312 100644 --- a/src/python.c +++ b/src/python.c @@ -239,8 +239,10 @@ static cpy_callback_t *cpy_shutdown_callbacks; static void cpy_destroy_user_data(void *data) { cpy_callback_t *c = data; free(c->name); + CPY_LOCK_THREADS Py_DECREF(c->callback); Py_XDECREF(c->data); + CPY_RELEASE_THREADS free(c); }