diff options
author | Guido van Rossum <guido@python.org> | 1997-08-02 02:57:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-02 02:57:45 (GMT) |
commit | 8cf047647418999fb8cd0e99b005b5fae8f50a3c (patch) | |
tree | 0096d6c949d2bdacca9bb1db4c707e3b2f0f129e /Objects | |
parent | 29e46a9a12592b89d81f87245b903486c589695a (diff) | |
download | cpython-8cf047647418999fb8cd0e99b005b5fae8f50a3c.zip cpython-8cf047647418999fb8cd0e99b005b5fae8f50a3c.tar.gz cpython-8cf047647418999fb8cd0e99b005b5fae8f50a3c.tar.bz2 |
Added internal routine PyString_Fini() which deletes all interned
strings. For use in Py_Finalize() only.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringobject.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 5e3f9fa..40dfc9e 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -1073,3 +1073,21 @@ PyString_InternFromString(cp) } #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 +} |