-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to use _input
will crash Godot
#189
Comments
Thanks! Do you know where that The only place where this type appears in the FFI header is
|
Here:
|
Sorry, I meant not the type but the pointer value. You suggested So I guess we would need to transmute a pointer from a different type ( |
yeah, just like how we currently just cast a pointer to ObjectPtr in the virtual method calls. |
Actually it seems like we need to do this for all object pointers |
Attempting to use
_input
will crash Godot, because we attempt to construct aGd<InputEvent>
directly from the pointer Godot sends us in the virtual call. However the pointer Godot sends us is actually aRef<InputEvent>
, which needs to be dereferenced usingref_get_object
first.A function defined on
Gd
like this does that properlyMy guess is that this is true for all objects inheriting from
RefCounted
in virtual methods. But it doesn't seem like there's a simple way to check this beyond just manually going through every virtual method and checking. Theextension_api.json
doesn't say anything.There isn't a simple hotfix for this beyond just expanding the macros and manually replacing the relevant call for
_input
. However doing so does fix the issue.The text was updated successfully, but these errors were encountered: