File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ What's New in Stackless 3.X.X?
2121- https://bitbucket.org/stackless-dev/stackless/issues/117
2222 Fix various reference leaks:
2323 - Leak of a reference to Py_None in generator.throw()
24-
24+ - Leak of a reference to the thread-id of every thread returned by stackless.threads
25+
2526 Additionally this change brings the handling of caught exceptions more in
2627 line with C-Python.
2728
Original file line number Diff line number Diff line change @@ -1524,9 +1524,16 @@ slpmodule_getthreads(PyObject *self)
15241524
15251525 for (ts = interp -> tstate_head ; ts != NULL ; ts = ts -> next ) {
15261526 PyObject * id = PyLong_FromLong (ts -> thread_id );
1527-
1528- if (id == NULL || PyList_Append (lis , id ))
1527+ if (id == NULL ) {
1528+ Py_DECREF (lis );
1529+ return NULL ;
1530+ }
1531+ if (PyList_Append (lis , id )) {
1532+ Py_DECREF (lis );
1533+ Py_DECREF (id );
15291534 return NULL ;
1535+ }
1536+ Py_DECREF (id );
15301537 }
15311538 PyList_Reverse (lis );
15321539 return lis ;
You can’t perform that action at this time.
0 commit comments