C#: Check if a class is a singleton using the Core name

Use the name of the class in Core, rather than the C# rename, when checking if a class is registered as a singleton.
This commit is contained in:
Raul Santos 2023-02-24 18:02:31 +01:00
parent 6296b46008
commit 3730d8e343
No known key found for this signature in database
GPG key ID: B532473AE3A803E4

View file

@ -2831,7 +2831,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
TypeInterface itype = TypeInterface::create_object_type(type_cname, pascal_to_pascal_case(type_cname), api_type); TypeInterface itype = TypeInterface::create_object_type(type_cname, pascal_to_pascal_case(type_cname), api_type);
itype.base_name = ClassDB::get_parent_class(type_cname); itype.base_name = ClassDB::get_parent_class(type_cname);
itype.is_singleton = Engine::get_singleton()->has_singleton(itype.proxy_name); itype.is_singleton = Engine::get_singleton()->has_singleton(type_cname);
itype.is_instantiable = class_info->creation_func && !itype.is_singleton; itype.is_instantiable = class_info->creation_func && !itype.is_singleton;
itype.is_ref_counted = ClassDB::is_parent_class(type_cname, name_cache.type_RefCounted); itype.is_ref_counted = ClassDB::is_parent_class(type_cname, name_cache.type_RefCounted);
itype.memory_own = itype.is_ref_counted; itype.memory_own = itype.is_ref_counted;