diff --git a/src/_macosx.m b/src/_macosx.m index dcb236a861f3..3e52fdf81459 100755 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -1287,8 +1287,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)