]> granicus.if.org Git - python/commitdiff
In _PyUnicode_Fini(), decref unicode_empty before tearng down the free
authorGuido van Rossum <guido@python.org>
Tue, 3 Oct 2000 18:09:04 +0000 (18:09 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 3 Oct 2000 18:09:04 +0000 (18:09 +0000)
list.  Discovered by Barry, fix approved by MAL.

Objects/unicodeobject.c

index b096faa3f29151b5d0e65f9f79d370937ac5fd71..8d04b2d0bb30f0475cca765cb083a82c6aab782e 100644 (file)
@@ -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;
 }