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

GDExtension: Use ObjectID when creating custom callable #83800

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions core/extension/gdextension_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ class CallableCustomExtension : public CallableCustom {
userdata = p_info->callable_userdata;
token = p_info->token;

if (p_info->object != nullptr) {
object = ((Object *)p_info->object)->get_instance_id();
}
object = p_info->object_id;

call_func = p_info->call_func;
is_valid_func = p_info->is_valid_func;
Expand Down
4 changes: 2 additions & 2 deletions core/extension/gdextension_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ typedef GDExtensionBool (*GDExtensionCallableCustomLessThan)(void *callable_user
typedef void (*GDExtensionCallableCustomToString)(void *callable_userdata, GDExtensionBool *r_is_valid, GDExtensionStringPtr r_out);

typedef struct {
/* Only `call_func` and `token` are strictly required, however, `object` should be passed if its not a static method.
/* Only `call_func` and `token` are strictly required, however, `object_id` should be passed if its not a static method.
*
* `token` should point to an address that uniquely identifies the GDExtension (for example, the
* `GDExtensionClassLibraryPtr` passed to the entry symbol function.
Expand All @@ -409,7 +409,7 @@ typedef struct {
void *callable_userdata;
void *token;

GDExtensionObjectPtr object;
GDObjectInstanceID object_id;

GDExtensionCallableCustomCall call_func;
GDExtensionCallableCustomIsValid is_valid_func;
Expand Down
Loading