From 066fbafdc3ba734a73b5f7fcfa1dbae67ddebf8a Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sun, 26 Feb 2017 12:52:12 +0100 Subject: Fix refcounting bug in set_new_condition_list() py_conditionlist is an owned reference (it gets passed to Py_DecRef() at the end), so we need to increment the refcount when assigning it from the borrowed reference py_conds. --- type_decoder.c | 1 + 1 file changed, 1 insertion(+) (limited to 'type_decoder.c') diff --git a/type_decoder.c b/type_decoder.c index 0858098..9481bdb 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -535,6 +535,7 @@ static int set_new_condition_list(PyObject *self, PyObject *args) num_conditions = PyList_Size(py_conditionlist); if (num_conditions == 0) return 9999; /* The PD invoked self.wait([]). */ + Py_IncRef(py_conditionlist); } else if (PyDict_Check(py_conds)) { /* 'py_conds' is a dict. */ if (PyDict_Size(py_conds) == 0) -- cgit v1.2.3-70-g09d2