fix py gc edge case (#2079)

This commit is contained in:
Awni Hannun
2025-04-18 12:46:53 -07:00
committed by GitHub
parent b529515eb1
commit 55935ccae7
3 changed files with 10 additions and 3 deletions

View File

@@ -16,12 +16,12 @@ struct gc_func {
};
int gc_func_tp_traverse(PyObject* self, visitproc visit, void* arg) {
Py_VISIT(Py_TYPE(self));
gc_func* w = (gc_func*)self;
Py_VISIT(w->func);
for (auto d : w->deps) {
Py_VISIT(d);
}
Py_VISIT(Py_TYPE(self));
return 0;
};