From 240b01025dcf6b38ccf451fbd95b3c6698853268 Mon Sep 17 00:00:00 2001 From: Sven Trenkel Date: Mon, 15 Aug 2016 18:51:25 +0000 Subject: [PATCH] python plugin: Grab GIL before freeing callbacks. If their refcount reaches 0 Python code will be executed. --- src/python.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- 2.11.0