Fixed AVIF and WEBP dealloc (#9501)

This commit is contained in:
Andrew Murray 2026-03-27 08:45:40 +11:00 committed by GitHub
parent d305ee6a25
commit fcecc8c6c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -425,7 +425,7 @@ end:
return (PyObject *)self;
}
PyObject *
void
_encoder_dealloc(AvifEncoderObject *self) {
if (self->encoder) {
avifEncoderDestroy(self->encoder);
@ -433,7 +433,7 @@ _encoder_dealloc(AvifEncoderObject *self) {
if (self->image) {
avifImageDestroy(self->image);
}
Py_RETURN_NONE;
Py_TYPE(self)->tp_free(self);
}
PyObject *
@ -687,13 +687,13 @@ AvifDecoderNew(PyObject *self_, PyObject *args) {
return (PyObject *)self;
}
PyObject *
void
_decoder_dealloc(AvifDecoderObject *self) {
if (self->decoder) {
avifDecoderDestroy(self->decoder);
}
PyBuffer_Release(&self->buffer);
Py_RETURN_NONE;
Py_TYPE(self)->tp_free(self);
}
PyObject *

View File

@ -219,6 +219,7 @@ _anim_encoder_dealloc(PyObject *self) {
WebPAnimEncoderObject *encp = (WebPAnimEncoderObject *)self;
WebPPictureFree(&(encp->frame));
WebPAnimEncoderDelete(encp->enc);
Py_TYPE(self)->tp_free(self);
}
PyObject *
@ -441,6 +442,7 @@ _anim_decoder_dealloc(PyObject *self) {
WebPAnimDecoderObject *decp = (WebPAnimDecoderObject *)self;
WebPDataClear(&(decp->data));
WebPAnimDecoderDelete(decp->dec);
Py_TYPE(self)->tp_free(self);
}
PyObject *