Use Py_CLEAR().

This commit is contained in:
Georg Brandl 2010-07-29 14:23:06 +00:00
parent 470a123910
commit 8ee604b989
1 changed files with 2 additions and 4 deletions

View File

@ -307,8 +307,7 @@ int unicode_resize(register PyUnicodeObject *unicode,
reset:
/* Reset the object caches */
if (unicode->defenc) {
Py_DECREF(unicode->defenc);
unicode->defenc = NULL;
Py_CLEAR(unicode->defenc);
}
unicode->hash = -1;
@ -427,8 +426,7 @@ void unicode_dealloc(register PyUnicodeObject *unicode)
unicode->length = 0;
}
if (unicode->defenc) {
Py_DECREF(unicode->defenc);
unicode->defenc = NULL;
Py_CLEAR(unicode->defenc);
}
/* Add to free list */
*(PyUnicodeObject **)unicode = free_list;