From: Marcus Comstedt Date: Mon, 27 Feb 2017 21:24:23 +0000 (+0100) Subject: More refcounting fixes X-Git-Tag: libsigrokdecode-0.5.0~72 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=01f15bdf8e0c9960991544d19848b81a67e3d423;p=libsigrokdecode.git More refcounting fixes PyList_SetItem steals a reference, so code calling that must either transfer ownership or increase the refcount. --- diff --git a/type_decoder.c b/type_decoder.c index 9481bdb..7836640 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -542,6 +542,7 @@ static int set_new_condition_list(PyObject *self, PyObject *args) return 9999; /* The PD invoked self.wait({}). */ /* Make a list and put the dict in there for convenience. */ py_conditionlist = PyList_New(1); + Py_IncRef(py_conds); PyList_SetItem(py_conditionlist, 0, py_conds); num_conditions = 1; } else {