Added internal routine PyString_Fini() which deletes all interned

strings.  For use in Py_Finalize() only.
This commit is contained in:
Guido van Rossum 1997-08-02 02:57:45 +00:00
parent 29e46a9a12
commit 8cf0476474
1 changed files with 18 additions and 0 deletions

View File

@ -1073,3 +1073,21 @@ PyString_InternFromString(cp)
} }
#endif #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
}