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
I found this initially when trying to convert rust closures into godot callables with gdextension (basically by creating an object specifically for calling that closure). and the above workaround wouldn't work for that use-case at least, since there's no way of making a lambda with gdextension as far as i know.
though it's good to know that something exists for gdscript at least.
Ran into this issue while trying to find a work around for the current lack of support for CallableCustom's in GDExtension. Manually increasing the RefCount will just cause it to never be freed.
Edit:
I believe this is because the Callable constructor takes a const Object* reference. Being const it wont modify the RefCount. So this makes sense to me now and im unsure if its a bug.
Godot version
4.0.stable
System information
Linux 5.10.167-1-MANJARO
Issue description
Creating a callable referencing a function from a RefCounted object does not ensure that the RefCounted object stays alive.
I would expect a callable to count as a reference for the ref-count.
Steps to reproduce
run
Godot will then error saying "Attempt to call function 'null::meow (Callable)' on a null instance."
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: