Code

python plugin: Grab GIL before freeing callbacks. If their refcount reaches 0 Python...
authorSven Trenkel <collectd@semidefinite.de>
Mon, 15 Aug 2016 18:51:25 +0000 (18:51 +0000)
committerSven Trenkel <collectd@semidefinite.de>
Mon, 15 Aug 2016 18:51:25 +0000 (18:51 +0000)
src/python.c

index 05a44aa842dae68fde0f2e9b7f20bffa9d836fb7..a682f3127d32ddfa74d2ada5e737462667b653ce 100644 (file)
@@ -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);
 }