From 9f913b6589384e5a8ef7a3acdab8867d21bc0292 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 28 Jan 2021 18:10:58 -0500 Subject: [PATCH] Dirty hack to avoid freeing TxOuts inside of Tuples --- gen_type_mapping.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gen_type_mapping.py b/gen_type_mapping.py index 371868f9..f57592f4 100644 --- a/gen_type_mapping.py +++ b/gen_type_mapping.py @@ -330,7 +330,13 @@ class TypeMappingGenerator: from_hu_conv = from_hu_conv + ", " conv.var_name = ty_info.var_name + "_" + chr(idx + ord("a")) conv_map = self.map_type_with_info(conv, False, None, is_free, holds_ref) - to_hu_conv_pfx = to_hu_conv_pfx + conv.java_ty + " " + ty_info.var_name + "_" + chr(idx + ord("a")) + " = " + "bindings." + self.tuple_types[ty_info.rust_obj][1] + "_get_" + chr(idx + ord("a")) + "(" + ty_info.var_name + ");\n" + to_hu_conv_pfx = to_hu_conv_pfx + conv.java_ty + " " + ty_info.var_name + "_" + chr(idx + ord("a")) + " = " + if not conv.is_native_primitive and (conv_map.rust_obj.replace("LDK", "") + "_clone") in self.clone_fns and conv_map.rust_obj == "LDKTxOut": + to_hu_conv_pfx = to_hu_conv_pfx + "bindings." + conv_map.rust_obj.replace("LDK", "") + "_clone(" + to_hu_conv_pfx = to_hu_conv_pfx + "bindings." + self.tuple_types[ty_info.rust_obj][1] + "_get_" + chr(idx + ord("a")) + "(" + ty_info.var_name + ")" + if not conv.is_native_primitive and (conv_map.rust_obj.replace("LDK", "") + "_clone") in self.clone_fns and conv_map.rust_obj == "LDKTxOut": # XXX + to_hu_conv_pfx = to_hu_conv_pfx + ")" + to_hu_conv_pfx = to_hu_conv_pfx + ";\n" if conv_map.to_hu_conv is not None: to_hu_conv_pfx = to_hu_conv_pfx + conv_map.to_hu_conv + ";\n" to_hu_conv_sfx = to_hu_conv_sfx + conv_map.to_hu_conv_name -- 2.39.5