From e279888f52f43be514361db6c806f9045782fe99 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Sun, 11 May 2025 09:07:55 -0400 Subject: [PATCH] Use Py_IncRef in pyaCallables.cc --- src/pya/pya/pyaCallables.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pya/pya/pyaCallables.cc b/src/pya/pya/pyaCallables.cc index 829f7076f..27f5fa790 100644 --- a/src/pya/pya/pyaCallables.cc +++ b/src/pya/pya/pyaCallables.cc @@ -49,7 +49,7 @@ pya_object_deallocate (PyObject *self) // may trigger a GC (https://github.com/KLayout/klayout/issues/1054). // According to the comments this may be turned into a release mode assertion, so // we better work around it. - ++self->ob_refcnt; + Py_IncRef(self); // Mute Python warnings in debug case PyObject_GC_UnTrack (self);