summaryrefslogtreecommitdiff
path: root/modules/mono/glue
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2022-08-27 17:18:13 +0200
committerRaul Santos <raulsntos@gmail.com>2022-08-27 17:35:53 +0200
commitebe008d41b112880ebac555ac7305de6b8a0b432 (patch)
tree35e4196bee58e59275722098768ca6abd1ffc823 /modules/mono/glue
parent85ef0a1058fb0acbf550b8d3674d02d9023de82b (diff)
C#: Fix byteCount in `NativeMemory.Alloc`
`NativeMemory.Alloc` takes the byte count as parameter, this is calculated by multiplying the element size in bytes by the length of the array.
Diffstat (limited to 'modules/mono/glue')
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs
index 0dc5ba7678..3884781988 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs
@@ -831,7 +831,7 @@ namespace Godot.Bridge
}
else
{
- interopProperties = ((godotsharp_property_info*)NativeMemory.Alloc((nuint)length))!;
+ interopProperties = ((godotsharp_property_info*)NativeMemory.Alloc((nuint)length, (nuint)sizeof(godotsharp_property_info)))!;
}
try
@@ -951,7 +951,7 @@ namespace Godot.Bridge
}
else
{
- interopDefaultValues = ((godotsharp_property_def_val_pair*)NativeMemory.Alloc((nuint)length))!;
+ interopDefaultValues = ((godotsharp_property_def_val_pair*)NativeMemory.Alloc((nuint)length, (nuint)sizeof(godotsharp_property_def_val_pair)))!;
}
try