Skip to content

Conversation

@Faless
Copy link
Contributor

@Faless Faless commented Sep 28, 2021

Added PtrToArg and GetTypeInfo adapted from Godot.

Also adds a test for it.

Note: Returning references from godot-cpp seem to always require an extra referencing. My guess it that when returning it to godot it gets passed as an object, and that Godot does not create it's internal Ref in time. The instance seem to be destroyed when expected with the extra reference() before return.

Fixes #628 .

Added PtrToArg and GetTypeInfo adapted from Godot.
@Faless Faless added bug This has been identified as a bug discussion topic:gdextension This relates to the new Godot 4 extension implementation labels Sep 28, 2021
@Faless Faless added this to the 4.0 milestone Sep 28, 2021
@akien-mga akien-mga merged commit 6a720e5 into godotengine:master Sep 28, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Note: Returning references from godot-cpp seem to always require an extra referencing. My guess it that when returning it to godot it gets passed as an object, and that Godot does not create it's internal Ref in time. The instance seem to be destroyed when expected with the extra reference() before return.

I suggest opening an issue to keep track of it.

Might also be relevant: godotengine/godot#53135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This has been identified as a bug discussion topic:gdextension This relates to the new Godot 4 extension implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't bind methods using Ref<T> as return type or argument

2 participants