Skip to content

Commit d1acb86

Browse files
Add a newline and don't re-lock for deallocating
1 parent e4ce835 commit d1acb86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/atexitmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ atexit_delete_cb(struct atexit_state *state, int i)
6767
atexit_py_callback *cb = state->callbacks[i];
6868
state->callbacks[i] = NULL;
6969

70-
// This can execute code via finalizers
70+
// We don't need to hold the lock; the entry isn't in the array anymore
7171
_PyAtExit_UNLOCK(state);
72+
7273
Py_DECREF(cb->func);
7374
Py_DECREF(cb->args);
7475
Py_XDECREF(cb->kwargs);
75-
_PyAtExit_LOCK(state);
7676
PyMem_Free(cb);
7777
}
7878

0 commit comments

Comments
 (0)