diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h index d5c4da1ac..046e47314 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h @@ -339,8 +339,8 @@ struct internals { internals &operator=(const internals &other) = delete; internals &operator=(internals &&other) = delete; ~internals() { - for (auto &[_, storage_ptr] : call_once_storage_map) { - delete storage_ptr; + for (auto &entry : call_once_storage_map) { + delete entry.second; } call_once_storage_map.clear(); }