Skip to content

Commit c6fddde

Browse files
committed
BUG: Fix signature_tuple refcount in ufunc loop registration
1 parent 1f8105a commit c6fddde

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

numpy/core/src/umath/ufunc_object.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5560,6 +5560,8 @@ PyUFunc_RegisterLoopForType(PyUFuncObject *ufunc,
55605560
goto fail;
55615561
}
55625562
}
5563+
/* Clearing sets it to NULL for the error paths */
5564+
Py_CLEAR(signature_tuple);
55635565

55645566
funcdata->func = function;
55655567
funcdata->arg_types = newtypes;
@@ -5630,7 +5632,6 @@ PyUFunc_RegisterLoopForType(PyUFuncObject *ufunc,
56305632
}
56315633
}
56325634
Py_DECREF(key);
5633-
Py_DECREF(signature_tuple);
56345635
return 0;
56355636

56365637
fail:

0 commit comments

Comments
 (0)