Skip to content

Commit aa64e11

Browse files
committed
Switch to using ObjectID in custom callables
1 parent c82f2a3 commit aa64e11

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gdextension/gdextension_interface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ typedef GDExtensionBool (*GDExtensionCallableCustomLessThan)(void *callable_user
392392
typedef void (*GDExtensionCallableCustomToString)(void *callable_userdata, GDExtensionBool *r_is_valid, GDExtensionStringPtr r_out);
393393

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

412-
GDExtensionObjectPtr object;
412+
uint64_t object_id;
413413

414414
GDExtensionCallableCustomCall call_func;
415415
GDExtensionCallableCustomIsValid is_valid_func;

src/variant/callable_method_pointer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Callable create_custom_callable(CallableCustomMethodPointerBase *p_callable_meth
5252
GDExtensionCallableCustomInfo info = {};
5353
info.callable_userdata = p_callable_method_pointer;
5454
info.token = internal::token;
55-
info.object = object != nullptr ? object->_owner : nullptr;
55+
info.object_id = object ? object->get_instance_id() : 0;
5656
info.call_func = &call_custom_callable;
5757
info.free_func = &free_custom_callable;
5858

0 commit comments

Comments
 (0)