X-Git-Url: http://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=session.c;fp=session.c;h=0c1ef8205634512f1d7de78a2e0d80f5ff2e271c;hp=14484504ce2fe9974cf707e14d822693b8331b67;hb=514b2edc54efda9c6698456748c4256bb901eddd;hpb=c1495906011ebabf97e799fe0f73e68ab0f1611a diff --git a/session.c b/session.c index 1448450..0c1ef82 100644 --- a/session.c +++ b/session.c @@ -131,11 +131,14 @@ static int srd_inst_send_meta(struct srd_decoder_inst *di, int key, GSList *l; struct srd_decoder_inst *next_di; int ret; + PyGILState_STATE gstate; if (key != SRD_CONF_SAMPLERATE) /* This is the only key we pass on to the decoder for now. */ return SRD_OK; + gstate = PyGILState_Ensure(); + if (PyObject_HasAttrString(di->py_inst, "metadata")) { py_ret = PyObject_CallMethod(di->py_inst, "metadata", "lK", (long)SRD_CONF_SAMPLERATE, @@ -143,6 +146,8 @@ static int srd_inst_send_meta(struct srd_decoder_inst *di, int key, Py_XDECREF(py_ret); } + PyGILState_Release(gstate); + /* Push metadata to all the PDs stacked on top of this one. */ for (l = di->next_di; l; l = l->next) { next_di = l->data;