Skip to content

Commit

Permalink
Fix side-exit leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Oct 1, 2024
1 parent 6f4d64b commit 984ca75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ uop_dealloc(_PyExecutorObject *self) {
_PyObject_GC_UNTRACK(self);
assert(self->vm_data.code == NULL);
unlink_executor(self);
for (uint32_t i = 0; i < self->exit_count; i++) {
Py_XDECREF(self->exits[i].executor);
}
#ifdef _Py_JIT
_PyJIT_Free(self);
#endif
Expand Down Expand Up @@ -1585,7 +1588,6 @@ executor_clear(_PyExecutorObject *executor)
*/
Py_INCREF(executor);
for (uint32_t i = 0; i < executor->exit_count; i++) {
executor->exits[i].temperature = initial_unreachable_backoff_counter();
Py_CLEAR(executor->exits[i].executor);
}
_Py_ExecutorDetach(executor);
Expand Down

0 comments on commit 984ca75

Please sign in to comment.