Skip to content

Commit 81a8608

Browse files
committed
Properly set GDExtensionBool is_valid to true in to_string function.
1 parent 08f24dc commit 81a8608

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

godot-core/src/registry/callbacks.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ pub unsafe extern "C" fn default_get_virtual<T: UserClass>(
188188

189189
pub unsafe extern "C" fn to_string<T: cap::GodotToString>(
190190
instance: sys::GDExtensionClassInstancePtr,
191-
_is_valid: *mut sys::GDExtensionBool,
191+
is_valid: *mut sys::GDExtensionBool,
192192
out_string: sys::GDExtensionStringPtr,
193193
) {
194194
// Note: to_string currently always succeeds, as it is only provided for classes that have a working implementation.
@@ -200,6 +200,7 @@ pub unsafe extern "C" fn to_string<T: cap::GodotToString>(
200200

201201
// Transfer ownership to Godot
202202
string.move_into_string_ptr(out_string);
203+
*is_valid = sys::conv::SYS_TRUE;
203204
}
204205

205206
#[cfg(before_api = "4.2")]

0 commit comments

Comments
 (0)