[Python-checkins] python/dist/src/Python pythonrun.c,2.188,2.189

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 17 Apr 2003 10:29:25 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv2992/Python

Modified Files:
	pythonrun.c 
Log Message:
- New C API PyGC_Collect(), same as calling gc.collect().
- Call this in Py_Finalize().
- Expand the Misc/NEWS text on PY_LONG_LONG.


Index: pythonrun.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v
retrieving revision 2.188
retrieving revision 2.189
diff -C2 -d -r2.188 -r2.189
*** pythonrun.c	17 Apr 2003 16:02:26 -0000	2.188
--- pythonrun.c	17 Apr 2003 17:29:22 -0000	2.189
***************
*** 256,261 ****
--- 256,269 ----
  	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 */