From 5cd79459646715df22763ab57de48c1783e6cbb9 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 12 Jan 2025 20:35:09 +0000 Subject: [PATCH] [C#] Free Uint128 byte buffers after to-human conversions --- csharp_strings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp_strings.py b/csharp_strings.py index 38330aef..9432489e 100644 --- a/csharp_strings.py +++ b/csharp_strings.py @@ -632,7 +632,7 @@ int CS_LDK_register_{fn_suffix}_invoker(invoker_{fn_suffix} invoker) {{ def primitive_arr_to_hu(self, arr_ty, fixed_len, arr_name, conv_name): mapped_ty = arr_ty.subty if arr_ty.rust_obj == "LDKU128": - return "org.ldk.util.UInt128 " + conv_name + " = new org.ldk.util.UInt128(" + arr_name + ");" + return "org.ldk.util.UInt128 " + conv_name + " = new org.ldk.util.UInt128(" + arr_name + ");\nbindings.free_buffer(" + arr_name + ");" elif mapped_ty.c_ty == "uint8_t" or mapped_ty.c_ty == "int8_t": return "byte[] " + conv_name + " = InternalUtils.decodeUint8Array(" + arr_name + ");" elif mapped_ty.c_ty == "uint16_t" or mapped_ty.c_ty == "int16_t": -- 2.39.5