diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index b4fc004..16d5929 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1826,12 +1826,15 @@ _PyUnicode_FromId(_Py_Identifier *id) void _PyUnicode_ClearStaticStrings() { - _Py_Identifier *i; - for (i = static_strings; i; i = i->next) { - Py_DECREF(i->object); - i->object = NULL; - i->next = NULL; - } + _Py_Identifier *tmp, *s = static_strings; + while (s) { + Py_DECREF(s->object); + s->object = NULL; + tmp = s->next; + s->next = NULL; + s = tmp; + } + static_strings = NULL; } /* Internal function, doesn't check maximum character */ |