From: Guido van Rossum Date: Tue, 3 Oct 2000 18:09:04 +0000 (+0000) Subject: In _PyUnicode_Fini(), decref unicode_empty before tearng down the free X-Git-Tag: v2.0c1~138 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ae8ef84da19892b828b9649a9565e967be4c0bd;p=python In _PyUnicode_Fini(), decref unicode_empty before tearng down the free list. Discovered by Barry, fix approved by MAL. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index b096faa3f2..8d04b2d0bb 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5225,6 +5225,8 @@ _PyUnicode_Fini(void) { PyUnicodeObject *u = unicode_freelist; + Py_XDECREF(unicode_empty); + unicode_empty = NULL; while (u != NULL) { PyUnicodeObject *v = u; u = *(PyUnicodeObject **)u; @@ -5235,6 +5237,4 @@ _PyUnicode_Fini(void) } unicode_freelist = NULL; unicode_freelist_size = 0; - Py_XDECREF(unicode_empty); - unicode_empty = NULL; }