Skip to content

Commit 801c4f1

Browse files
Clarify the reference for the parameters
1 parent d1acb86 commit 801c4f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/atexitmodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ atexit_callfuncs(struct atexit_state *state)
152152

153153
// bpo-46025: Increment the refcount of cb->func as the call itself may unregister it
154154
PyObject *func = Py_NewRef(cb->func);
155+
// No need to hold a strong reference to the arguments though
155156
PyObject *args = cb->args;
156157
PyObject *kwargs = cb->kwargs;
158+
157159
// Unlock for re-entrancy problems
158160
_PyAtExit_UNLOCK(state);
159161
PyObject *res = PyObject_Call(func, args, kwargs);

0 commit comments

Comments
 (0)