File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ What's New in Stackless 3.X.X?
21
21
- https://bitbucket.org/stackless-dev/stackless/issues/117
22
22
Fix various reference leaks:
23
23
- 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
+
25
26
Additionally this change brings the handling of caught exceptions more in
26
27
line with C-Python.
27
28
Original file line number Diff line number Diff line change @@ -1524,9 +1524,16 @@ slpmodule_getthreads(PyObject *self)
1524
1524
1525
1525
for (ts = interp -> tstate_head ; ts != NULL ; ts = ts -> next ) {
1526
1526
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 );
1529
1534
return NULL ;
1535
+ }
1536
+ Py_DECREF (id );
1530
1537
}
1531
1538
PyList_Reverse (lis );
1532
1539
return lis ;
You can’t perform that action at this time.
0 commit comments