mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
GDExtension: Check if class without recreate callback is creatable, before marking whole extension as unreloadable
This commit is contained in:
@@ -410,9 +410,17 @@ void GDExtension::_register_extension_class_internal(GDExtensionClassLibraryPtr
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (self->reloadable && p_extension_funcs->recreate_instance_func == nullptr) {
|
if (self->reloadable && p_extension_funcs->recreate_instance_func == nullptr) {
|
||||||
|
bool can_create_class = (bool)p_extension_funcs->create_instance_func;
|
||||||
|
#ifndef DISABLE_DEPRECATED
|
||||||
|
if (!can_create_class && p_deprecated_funcs) {
|
||||||
|
can_create_class = (bool)p_deprecated_funcs->create_instance_func;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (can_create_class) {
|
||||||
ERR_PRINT(vformat("Extension marked as reloadable, but attempted to register class '%s' which doesn't support reloading. Perhaps your language binding don't support it? Reloading disabled for this extension.", class_name));
|
ERR_PRINT(vformat("Extension marked as reloadable, but attempted to register class '%s' which doesn't support reloading. Perhaps your language binding don't support it? Reloading disabled for this extension.", class_name));
|
||||||
self->reloadable = false;
|
self->reloadable = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extension->gdextension.library = self;
|
extension->gdextension.library = self;
|
||||||
extension->gdextension.parent_class_name = parent_class_name;
|
extension->gdextension.parent_class_name = parent_class_name;
|
||||||
|
|||||||
Reference in New Issue
Block a user