diff --git a/src/core/class_db.cpp b/src/core/class_db.cpp index 9d9d1c7bb0..201e08d25c 100644 --- a/src/core/class_db.cpp +++ b/src/core/class_db.cpp @@ -353,7 +353,7 @@ void ClassDB::initialize(GDExtensionInitializationLevel p_level) { void ClassDB::deinitialize(GDExtensionInitializationLevel p_level) { std::set to_erase; - for (const auto& name : class_register_order) { + for (const StringName& name : class_register_order) { const ClassInfo &cl = classes[name]; if (cl.level != p_level) { @@ -362,7 +362,7 @@ void ClassDB::deinitialize(GDExtensionInitializationLevel p_level) { internal::gdextension_interface_classdb_unregister_extension_class(internal::library, name._native_ptr()); - for (auto method : cl.method_map) { + for (std::pair method : cl.method_map) { memdelete(method.second); } @@ -371,8 +371,8 @@ void ClassDB::deinitialize(GDExtensionInitializationLevel p_level) { } { - // The following is equivalent to c++20 `std::erase_if(class_register_order, [&](const auto& name){ return to_erase.contains(name); });` - auto it = std::remove_if(class_register_order.begin(), class_register_order.end(), [&](const StringName& name) { + // The following is equivalent to c++20 `std::erase_if(class_register_order, [&](const StringName& name){ return to_erase.contains(name); });` + std::vector::iterator it = std::remove_if(class_register_order.begin(), class_register_order.end(), [&](const StringName& name) { return to_erase.count(name) > 0; }); class_register_order.erase(it, class_register_order.end());