diff options
author | David Snopek <dsnopek@gmail.com> | 2023-06-20 08:24:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-20 08:24:56 -0500 |
commit | 2377f7ec7505645a328bec6ec91bf17aa4e471c3 (patch) | |
tree | d272f92b105b20f01b7149b757d24ede7b3c9b3d /include/godot_cpp | |
parent | 82edc89cfa502f1fc7598a1f11e623f49511f98e (diff) | |
parent | 20be441026ce3e294bef110279233a8168d219c9 (diff) | |
download | redot-cpp-2377f7ec7505645a328bec6ec91bf17aa4e471c3.tar.gz |
Merge pull request #1047 from Kehom/master
Unregister custom classes in reverse registration order
Diffstat (limited to 'include/godot_cpp')
-rw-r--r-- | include/godot_cpp/core/class_db.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/godot_cpp/core/class_db.hpp b/include/godot_cpp/core/class_db.hpp index 425d5a2..b1625bf 100644 --- a/include/godot_cpp/core/class_db.hpp +++ b/include/godot_cpp/core/class_db.hpp @@ -105,6 +105,8 @@ private: // This may only contain custom classes, not Godot classes static std::unordered_map<StringName, ClassInfo> classes; static std::unordered_map<StringName, const GDExtensionInstanceBindingCallbacks *> instance_binding_callbacks; + // Used to remember the custom class registration order. + static std::vector<StringName> class_register_order; static MethodBind *bind_methodfi(uint32_t p_flags, MethodBind *p_bind, const MethodDefinition &method_name, const void **p_defs, int p_defcount); static void initialize_class(const ClassInfo &cl); @@ -178,6 +180,7 @@ void ClassDB::_register_class(bool p_virtual) { cl.parent_ptr = &parent_it->second; } classes[cl.name] = cl; + class_register_order.push_back(cl.name); // Register this class with Godot GDExtensionClassCreationInfo class_info = { |