When we call RefCounted.unreference, if this returns true, we can call the GDExtension object_destroy
We probably want this on RefCounted deinit {}
The longer story is that RefCounted is exposed as a Ref.
We should also figure out when we own the reference and when we do not.
It seems that return from functions, we do not need to call reference, we own it. But parameters to callbacks, we would need to take a reference when we wrap (and let the deinitializer call the unreference)
After some discussion with the Godot folks:
RefCounted.unreference
, if this returns true, we can call the GDExtensionobject_destroy
We probably want this on RefCounted deinit {}
The longer story is that RefCounted is exposed as a Ref.
We should also figure out when we own the reference and when we do not.
It seems that return from functions, we do not need to call
reference
, we own it. But parameters to callbacks, we would need to take a reference when we wrap (and let the deinitializer call theunreference
)