Issue #1545463: Global variables caught in reference cycles are now garbage-collected at shutdown.

This commit is contained in:
Antoine Pitrou 2013-05-06 21:15:57 +02:00
parent 1df37c657d
commit 5f454a07a0
6 changed files with 56 additions and 5 deletions

View file

@ -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);
}