Merge pull request #1224 from lkesteloot/master

Release GIL during image load (decode).
This commit is contained in:
Hugo 2015-05-13 18:09:01 +03:00
commit c70e166a77

View File

@ -116,12 +116,17 @@ _decode(ImagingDecoderObject* decoder, PyObject* args)
{
UINT8* buffer;
int bufsize, status;
ImagingSectionCookie cookie;
if (!PyArg_ParseTuple(args, PY_ARG_BYTES_LENGTH, &buffer, &bufsize))
return NULL;
ImagingSectionEnter(&cookie);
status = decoder->decode(decoder->im, &decoder->state, buffer, bufsize);
ImagingSectionLeave(&cookie);
return Py_BuildValue("ii", status, decoder->state.errcode);
}