else:
java_trait_constr = java_trait_constr + arg_info.arg_name
- java_trait_constr = java_trait_constr + ");\n"
+ java_trait_constr += ");\n"
+ java_trait_constr += "\t\t\t\tReference.reachabilityFence(arg);\n"
if fn_line.ret_ty_info.java_ty != "void":
if fn_line.ret_ty_info.from_hu_conv is not None:
java_trait_constr = java_trait_constr + "\t\t\t\t" + fn_line.ret_ty_info.java_ty + " result = " + fn_line.ret_ty_info.from_hu_conv[0] + ";\n"
import org.ldk.enums.Recipient;
import org.ldk.impl.bindings;
+import java.lang.ref.Reference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
deliver_peer_messages(list, peer1.peer_manager, peer2.peer_manager);
ArrayList<Long> events = new ArrayList();
- long handler = bindings.LDKEventHandler_new(events::add);
+ bindings.LDKEventHandler events_adder = events::add;
+ long handler = bindings.LDKEventHandler_new(events_adder);
bindings.EventsProvider_process_pending_events(peer1.chan_manager_events, handler);
assert events.size() == 1;
bindings.LDKEvent sent_path = bindings.LDKEvent_ref_from_ptr(events.get(0));
assert sent_path instanceof bindings.LDKEvent.PaymentPathSuccessful;
bindings.Event_free(events.remove(0));
+ Reference.reachabilityFence(events_adder);
bindings.EventHandler_free(handler);