diff --git a/_imagingft.c b/_imagingft.c index dc1661f3e..218d8b141 100644 --- a/_imagingft.c +++ b/_imagingft.c @@ -153,7 +153,7 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw) if (self->font_bytes) { PyMem_Free(self->font_bytes); } - PyObject_Del(self); + Py_DECREF(self); return geterror(error); } diff --git a/map.c b/map.c index dc9ead0aa..7309a7bd7 100644 --- a/map.c +++ b/map.c @@ -73,7 +73,7 @@ PyImaging_MapperNew(const char* filename, int readonly) NULL); if (mapper->hFile == (HANDLE)-1) { PyErr_SetString(PyExc_IOError, "cannot open file"); - PyObject_Del(mapper); + Py_DECREF(mapper); return NULL; } @@ -84,7 +84,7 @@ PyImaging_MapperNew(const char* filename, int readonly) if (mapper->hMap == (HANDLE)-1) { CloseHandle(mapper->hFile); PyErr_SetString(PyExc_IOError, "cannot map file"); - PyObject_Del(mapper); + Py_DECREF(mapper); return NULL; }