From: Victor Stinner Date: Thu, 1 May 2025 11:42:42 +0000 (+0200) Subject: gh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack() (#133199) X-Git-Tag: v3.14.0b1~143 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=662dd294563ce86980c640ad67e3d460a72c9cb9;p=thirdparty%2FPython%2Fcpython.git gh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack() (#133199) Replace _PyObject_GC_UNTRACK() with PyObject_GC_UnTrack() to not fail if the method was already untracked. --- diff --git a/Objects/classobject.c b/Objects/classobject.c index 58e1d1797732..b5df3d1a41b5 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -244,7 +244,7 @@ static void method_dealloc(PyObject *self) { PyMethodObject *im = _PyMethodObject_CAST(self); - _PyObject_GC_UNTRACK(im); + PyObject_GC_UnTrack(im); if (im->im_weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *)im); Py_DECREF(im->im_func);