diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-01-09 15:52:22 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-01-09 15:52:22 (GMT) |
commit | 0b32a480bd0ddd25d0a2f511861c160590296ce2 (patch) | |
tree | 99749c6a10c6daa6de3ba83d7a5090028125f0ad /Objects | |
parent | df558cb3b1f6e766e17a203856fb38eae1d3a366 (diff) | |
parent | 0c270a8bb748f09b7de6f6ce21d405e0c83be329 (diff) | |
download | cpython-0b32a480bd0ddd25d0a2f511861c160590296ce2.zip cpython-0b32a480bd0ddd25d0a2f511861c160590296ce2.tar.gz cpython-0b32a480bd0ddd25d0a2f511861c160590296ce2.tar.bz2 |
merge 3.3 (#16906)
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 41c3549..6a12d71 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1822,12 +1822,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 */ |