Commit 6586e95f authored by Guido van Rossum's avatar Guido van Rossum

In _PyUnicode_Fini(), decref unicode_empty before tearng down the free

list.  Discovered by Barry, fix approved by MAL.
parent 968e3640
...@@ -5225,6 +5225,8 @@ _PyUnicode_Fini(void) ...@@ -5225,6 +5225,8 @@ _PyUnicode_Fini(void)
{ {
PyUnicodeObject *u = unicode_freelist; PyUnicodeObject *u = unicode_freelist;
Py_XDECREF(unicode_empty);
unicode_empty = NULL;
while (u != NULL) { while (u != NULL) {
PyUnicodeObject *v = u; PyUnicodeObject *v = u;
u = *(PyUnicodeObject **)u; u = *(PyUnicodeObject **)u;
...@@ -5235,6 +5237,4 @@ _PyUnicode_Fini(void) ...@@ -5235,6 +5237,4 @@ _PyUnicode_Fini(void)
} }
unicode_freelist = NULL; unicode_freelist = NULL;
unicode_freelist_size = 0; unicode_freelist_size = 0;
Py_XDECREF(unicode_empty);
unicode_empty = NULL;
} }
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