]> sigrok.org Git - libsigrokdecode.git/commitdiff
More refcounting fixes
authorMarcus Comstedt <redacted>
Mon, 27 Feb 2017 21:24:23 +0000 (22:24 +0100)
committerUwe Hermann <redacted>
Tue, 28 Feb 2017 14:00:28 +0000 (15:00 +0100)
PyList_SetItem steals a reference, so code calling that must either
transfer ownership or increase the refcount.

type_decoder.c

index 9481bdb409feebf83d74bc40ad45107f3c034c08..7836640c45d4702765596b3f9fe88331d5248dbb 100644 (file)
@@ -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 {