diff --git a/src/_macosx.m b/src/_macosx.m index 6df00d0eca8e..a580362f676f 100755 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -1132,8 +1132,10 @@ - (void)setCanvas: (PyObject*)newCanvas } static void _buffer_release(void* info, const void* data, size_t size) { + PyGILState_STATE gstate = PyGILState_Ensure(); PyBuffer_Release((Py_buffer *)info); free(info); + PyGILState_Release(gstate); } static int _copy_agg_buffer(CGContextRef cr, PyObject *renderer)