summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-04-17 17:29:22 (GMT)
committerGuido van Rossum <guido@python.org>2003-04-17 17:29:22 (GMT)
commite13ddc9ec85287b17fd03454f836f495c1167de9 (patch)
tree20de9aa63915e14e39d87fc7a4e88a39c9eb03c7 /Python
parentcf8d285ba321dcb1c479a16d15e0224b3ad05970 (diff)
downloadcpython-e13ddc9ec85287b17fd03454f836f495c1167de9.zip
cpython-e13ddc9ec85287b17fd03454f836f495c1167de9.tar.gz
cpython-e13ddc9ec85287b17fd03454f836f495c1167de9.tar.bz2
- New C API PyGC_Collect(), same as calling gc.collect().
- Call this in Py_Finalize(). - Expand the Misc/NEWS text on PY_LONG_LONG.
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index a84186c..4cfb664 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -255,9 +255,17 @@ Py_Finalize(void)
Py_XDECREF(PyModule_WarningsModule);
PyModule_WarningsModule = NULL;
+ /* Collect garbage. This may call finalizers; it's nice to call these
+ before all modules are destroyed. */
+ PyGC_Collect();
+
/* Destroy all modules */
PyImport_Cleanup();
+ /* Collect final garbage. This disposes of cycles created by
+ new-style class definitions, for example. */
+ PyGC_Collect();
+
/* Destroy the database used by _PyImport_{Fixup,Find}Extension */
_PyImport_Fini();