C#: Fix issues for StringName reference in `CSharpInstanceBridge.Get`.

(cherry picked from commit 1e14503715)
This commit is contained in:
Zae 2024-01-29 02:04:02 +08:00 committed by Rémi Verschelde
parent 562613ac37
commit 1b90b9ad05
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ namespace Godot.Bridge
// Signals // Signals
if (godotObject.HasGodotClassSignal(CustomUnsafe.AsRef(name))) if (godotObject.HasGodotClassSignal(CustomUnsafe.AsRef(name)))
{ {
godot_signal signal = new godot_signal(*name, godotObject.GetInstanceId()); godot_signal signal = new godot_signal(NativeFuncs.godotsharp_string_name_new_copy(*name), godotObject.GetInstanceId());
*outRet = VariantUtils.CreateFromSignalTakingOwnershipOfDisposableValue(signal); *outRet = VariantUtils.CreateFromSignalTakingOwnershipOfDisposableValue(signal);
return godot_bool.True; return godot_bool.True;
} }
@ -102,7 +102,7 @@ namespace Godot.Bridge
// Methods // Methods
if (godotObject.HasGodotClassMethod(CustomUnsafe.AsRef(name))) if (godotObject.HasGodotClassMethod(CustomUnsafe.AsRef(name)))
{ {
godot_callable method = new godot_callable(*name, godotObject.GetInstanceId()); godot_callable method = new godot_callable(NativeFuncs.godotsharp_string_name_new_copy(*name), godotObject.GetInstanceId());
*outRet = VariantUtils.CreateFromCallableTakingOwnershipOfDisposableValue(method); *outRet = VariantUtils.CreateFromCallableTakingOwnershipOfDisposableValue(method);
return godot_bool.True; return godot_bool.True;
} }