Mercurial > cpython-lru_cache-weakref
diff Objects/stringobject.c @ 5920:5fb30413b93b legacy-trunk
Added internal routine PyString_Fini() which deletes all interned
strings. For use in Py_Finalize() only.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sat, 02 Aug 1997 02:57:45 +0000 |
| parents | 3c67436a28e6 |
| children | d77d3b8e86b2 |
line wrap: on
line diff
--- a/Objects/stringobject.c Sat Aug 02 02:56:48 1997 +0000 +++ b/Objects/stringobject.c Sat Aug 02 02:57:45 1997 +0000 @@ -1073,3 +1073,21 @@ } #endif + +void +PyString_Fini() +{ + int i; +#ifdef INTERN_STRINGS + Py_XDECREF(interned); + interned = NULL; +#endif + for (i = 0; i < UCHAR_MAX + 1; i++) { + Py_XDECREF(characters[i]); + characters[i] = NULL; + } +#ifndef DONT_SHARE_SHORT_STRINGS + Py_XDECREF(nullstring); + nullstring = NULL; +#endif +}
