Skip to content
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

ScriptInstanceExtension GDExtensionObjectPtr is no longer readable on Godot Side #78116

Closed
Gallilus opened this issue Jun 11, 2023 · 3 comments · Fixed by #78392
Closed

ScriptInstanceExtension GDExtensionObjectPtr is no longer readable on Godot Side #78116

Gallilus opened this issue Jun 11, 2023 · 3 comments · Fixed by #78392

Comments

@Gallilus
Copy link
Contributor

Gallilus commented Jun 11, 2023

Godot version

v4.1.beta

System information

Windows 10

Issue description

        virtual Ref<Script> get_script() const override {
                if (native_info->get_script_func) {
                        GDExtensionObjectPtr script = native_info->get_script_func(instance);
                        return Ref<Script>(reinterpret_cast<Script *>(script));
                }
                return Ref<Script>();

Is not creating a functional reference.

GDExtensionObjectPtr is a part of gdextension_interface and is a void pointer to pas data pointers between GDExtesion and Godot Core.

In the images below you are able to see that the extension reinterpret_cast works fine.
And that the pointer is passed to core.
However at core Ref<Script> script_test stays a NULL value

image
image
image

I was hoping this would be solved by solving cpp 1119

Steps to reproduce

Create a custom script instance and create it using internal::gdextension_interface_script_instance_create and a GDExtensionScriptInstanceInfo that only implements get_property_list_func and get_script_func.

Minimal reproduction project

Difficult to create a minimal project.
Mostly looking for advice on what to test to find the actual source problem

@YuriSizov
Copy link
Contributor

cc @dsnopek

@Gallilus

This comment was marked as outdated.

@Gallilus
Copy link
Contributor Author

#63712 (comment)
#78392

I hope it is fixed with both of above need to fix several regressions during testing before I'm sure this issue is caused by the bug

@akien-mga akien-mga added this to the 4.1 milestone Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants