mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 21:50:54 +03:00
Do not DECREF individual list items, reverting grouping
This commit is contained in:
parent
0ea1184bcf
commit
7632d8df36
|
@ -1114,7 +1114,7 @@ font_getvarnames(FontObject *self) {
|
|||
|
||||
static PyObject *
|
||||
font_getvaraxes(FontObject *self) {
|
||||
int error, failed = 0;
|
||||
int error;
|
||||
FT_UInt i, j, num_axis, name_count;
|
||||
FT_MM_Var *master;
|
||||
FT_Var_Axis axis;
|
||||
|
@ -1137,8 +1137,9 @@ font_getvaraxes(FontObject *self) {
|
|||
|
||||
list_axis = PyDict_New();
|
||||
if (list_axis == NULL) {
|
||||
failed = 1;
|
||||
} else {
|
||||
Py_DECREF(list_axes);
|
||||
return NULL;
|
||||
}
|
||||
PyObject *minimum = PyLong_FromLong(axis.minimum / 65536);
|
||||
PyDict_SetItemString(list_axis, "minimum", minimum ? minimum : Py_None);
|
||||
Py_XDECREF(minimum);
|
||||
|
@ -1155,8 +1156,8 @@ font_getvaraxes(FontObject *self) {
|
|||
error = FT_Get_Sfnt_Name(self->face, j, &name);
|
||||
if (error) {
|
||||
Py_DECREF(list_axis);
|
||||
failed = 1;
|
||||
break;
|
||||
Py_DECREF(list_axes);
|
||||
return geterror(error);
|
||||
}
|
||||
|
||||
if (name.name_id == axis.strid) {
|
||||
|
@ -1166,18 +1167,6 @@ font_getvaraxes(FontObject *self) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (failed) {
|
||||
for (j = 0; j < i; j++) {
|
||||
list_axis = PyList_GetItem(list_axes, j);
|
||||
Py_DECREF(list_axis);
|
||||
}
|
||||
Py_DECREF(list_axes);
|
||||
if (error) {
|
||||
return geterror(error);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyList_SetItem(list_axes, i, list_axis);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user