Commit 0c270a8b authored by Benjamin Peterson's avatar Benjamin Peterson

correct static string clearing loop (closes #16906)

parent 71317499
...@@ -12,6 +12,9 @@ What's New in Python 3.3.1? ...@@ -12,6 +12,9 @@ What's New in Python 3.3.1?
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #16906: Fix a logic error that prevented most static strings from being
cleared.
- Issue #11461: Fix the incremental UTF-16 decoder. Original patch by - Issue #11461: Fix the incremental UTF-16 decoder. Original patch by
Amaury Forgeot d'Arc. Amaury Forgeot d'Arc.
......
...@@ -1826,12 +1826,15 @@ _PyUnicode_FromId(_Py_Identifier *id) ...@@ -1826,12 +1826,15 @@ _PyUnicode_FromId(_Py_Identifier *id)
void void
_PyUnicode_ClearStaticStrings() _PyUnicode_ClearStaticStrings()
{ {
_Py_Identifier *i; _Py_Identifier *tmp, *s = static_strings;
for (i = static_strings; i; i = i->next) { while (s) {
Py_DECREF(i->object); Py_DECREF(s->object);
i->object = NULL; s->object = NULL;
i->next = NULL; tmp = s->next;
} s->next = NULL;
s = tmp;
}
static_strings = NULL;
} }
/* Internal function, doesn't check maximum character */ /* Internal function, doesn't check maximum character */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment