mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 13:12:42 +00:00
Merge pull request #98467 from zaevi/fix_csharp_stringname_leak
C#: Fix StringName leak when converting `Variant` to `Signal` / `Callable`
This commit is contained in:
commit
0dd003d7d2
@ -534,7 +534,10 @@ namespace Godot.NativeInterop
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Callable ConvertToCallable(in godot_variant p_var)
|
||||
=> Marshaling.ConvertCallableToManaged(ConvertToNativeCallable(p_var));
|
||||
{
|
||||
using var callable = ConvertToNativeCallable(p_var);
|
||||
return Marshaling.ConvertCallableToManaged(callable);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static godot_signal ConvertToNativeSignal(in godot_variant p_var)
|
||||
@ -542,7 +545,10 @@ namespace Godot.NativeInterop
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Signal ConvertToSignal(in godot_variant p_var)
|
||||
=> Marshaling.ConvertSignalToManaged(ConvertToNativeSignal(p_var));
|
||||
{
|
||||
using var signal = ConvertToNativeSignal(p_var);
|
||||
return Marshaling.ConvertSignalToManaged(signal);
|
||||
}
|
||||
|
||||
public static godot_array ConvertToNativeArray(in godot_variant p_var)
|
||||
=> p_var.Type == Variant.Type.Array ?
|
||||
|
Loading…
Reference in New Issue
Block a user