summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2023-06-20 08:24:56 -0500
committerGitHub <noreply@github.com>2023-06-20 08:24:56 -0500
commit2377f7ec7505645a328bec6ec91bf17aa4e471c3 (patch)
treed272f92b105b20f01b7149b757d24ede7b3c9b3d /include/godot_cpp
parent82edc89cfa502f1fc7598a1f11e623f49511f98e (diff)
parent20be441026ce3e294bef110279233a8168d219c9 (diff)
downloadredot-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.hpp3
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 = {