]> git.bitcoin.ninja Git - ldk-java/commitdiff
[C#] Free Uint128 byte buffers after to-human conversions
authorMatt Corallo <git@bluematt.me>
Sun, 12 Jan 2025 20:35:09 +0000 (20:35 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 17 Jan 2025 18:57:14 +0000 (18:57 +0000)
csharp_strings.py

index 38330aef6d69a6c74baac5d6cc4a8d6e0ff234d1..9432489ec23bbd30dc674856f8692137e7a95d79 100644 (file)
@@ -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":