We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8be3b2f commit 5fd5336Copy full SHA for 5fd5336
1 file changed
Python/optimizer.c
@@ -1669,12 +1669,14 @@ executor_clear(PyObject *op)
1669
* free the executor unless we hold a strong reference to it
1670
*/
1671
_PyExecutorObject *cold = _PyExecutor_GetColdExecutor();
1672
+ _PyExecutorObject *cold_dynamic = _PyExecutor_GetColdDynamicExecutor();
1673
Py_INCREF(executor);
1674
for (uint32_t i = 0; i < executor->exit_count; i++) {
1675
executor->exits[i].temperature = initial_unreachable_backoff_counter();
1676
_PyExecutorObject *e = executor->exits[i].executor;
- executor->exits[i].executor = cold;
1677
- Py_DECREF(e);
+ if (e != cold && e != cold_dynamic) {
1678
+ executor_clear(e);
1679
+ }
1680
}
1681
_Py_ExecutorDetach(executor);
1682
Py_DECREF(executor);
0 commit comments