This fixes parts of bug #329.
return SRD_ERR_PYTHON;
}
+static void release_meta(GVariant *gvar)
+{
+ if (!gvar)
+ return;
+ g_variant_unref(gvar);
+}
+
static PyObject *Decoder_put(PyObject *self, PyObject *args)
{
GSList *l;
struct srd_pd_callback *cb;
PyGILState_STATE gstate;
+ py_data = NULL;
+
gstate = PyGILState_Ensure();
if (!(di = srd_inst_find_by_obj(NULL, self))) {
Py_BEGIN_ALLOW_THREADS
cb->cb(&pdata, cb->cb_data);
Py_END_ALLOW_THREADS
+ release_meta(pdata.data);
}
break;
default:
break;
}
+ if (py_data)
+ Py_DECREF(py_data);
+
PyGILState_Release(gstate);
Py_RETURN_NONE;
err:
+ if (py_data)
+ Py_DECREF(py_data);
+
PyGILState_Release(gstate);
return NULL;