You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GDExtension allows classes to be registered without a default constructor. They can either have custom constructors (static methods) that are invokable from GDScript, or non-exposed constructors only available in the binding language. This can be done by not providing create and recreate function pointers during class registration, and optionally marking a class as abstract.
However, without a recreate callback, Godot emits the error message:
Extension marked as reloadable, but attempted to register class 'MyClass' which doesn't support reloading. Perhaps your language binding don't support it? Reloading disabled for this extension.
This might be a bit too much because:
Not having a recreate callback shouldn't be a problem until there are actual instances of such a class to be reloaded.
Even then, Godot shouldn't disable reloading for the entire extension just because of one class.
The only workaround seems to be providing a dummy recreate function, although I haven't tested this, and I don't know if it has any other implications.
Steps to reproduce
Set reloadable = true in the .gdextension file.
Register a class in GDExtension with create_instance_func and recreate_instance_func function pointers set to null.
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered:
I think we should probably update the check in GDExtension::_register_extension_class_internal() to see if the class is creatable in the first place, before deciding the extension can't be reloaded.
Tested versions
4.3-stable and before
System information
All systems
Issue description
GDExtension allows classes to be registered without a default constructor. They can either have custom constructors (static methods) that are invokable from GDScript, or non-exposed constructors only available in the binding language. This can be done by not providing
create
andrecreate
function pointers during class registration, and optionally marking a class asabstract
.However, without a
recreate
callback, Godot emits the error message:This might be a bit too much because:
recreate
callback shouldn't be a problem until there are actual instances of such a class to be reloaded.The only workaround seems to be providing a dummy
recreate
function, although I haven't tested this, and I don't know if it has any other implications.Steps to reproduce
Set
reloadable = true
in the.gdextension
file.Register a class in GDExtension with
create_instance_func
andrecreate_instance_func
function pointers set to null.Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: