Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 072226a

Browse files
committed
Ensure GIL while releasing buffer
1 parent f05167c commit 072226a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/_macosx.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,8 +1132,10 @@ - (void)setCanvas: (PyObject*)newCanvas
11321132
}
11331133

11341134
static void _buffer_release(void* info, const void* data, size_t size) {
1135+
PyGILState_STATE gstate = PyGILState_Ensure();
11351136
PyBuffer_Release((Py_buffer *)info);
11361137
free(info);
1138+
PyGILState_Release(gstate);
11371139
}
11381140

11391141
static int _copy_agg_buffer(CGContextRef cr, PyObject *renderer)

0 commit comments

Comments
 (0)