mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #1545463: Global variables caught in reference cycles are now garbage-collected at shutdown.
This commit is contained in:
parent
1df37c657d
commit
5f454a07a0
6 changed files with 56 additions and 5 deletions
|
|
@ -1544,8 +1544,9 @@ PyGC_Collect(void)
|
|||
return n;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_PyGC_Fini(void)
|
||||
_PyGC_DumpShutdownStats(void)
|
||||
{
|
||||
if (!(debug & DEBUG_SAVEALL)
|
||||
&& garbage != NULL && PyList_GET_SIZE(garbage) > 0) {
|
||||
|
|
@ -1574,6 +1575,11 @@ _PyGC_Fini(void)
|
|||
Py_XDECREF(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_PyGC_Fini(void)
|
||||
{
|
||||
Py_CLEAR(callbacks);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue