* Note that scorer (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public static BackgroundProcessor start(Persister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, GossipSync gossip_sync, PeerManager peer_manager, Logger logger, @Nullable MultiThreadedLockableScore scorer) {
- long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr & ~1, channel_manager == null ? 0 : channel_manager.ptr & ~1, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr & ~1, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr & ~1);
+ long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr);
Reference.reachabilityFence(persister);
Reference.reachabilityFence(event_handler);
Reference.reachabilityFence(chain_monitor);
Reference.reachabilityFence(scorer);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.BackgroundProcessor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BackgroundProcessor(null, ret); }
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- ret_hu_conv.ptrs_to.add(persister);
- ret_hu_conv.ptrs_to.add(event_handler);
- ret_hu_conv.ptrs_to.add(chain_monitor);
- ret_hu_conv.ptrs_to.add(channel_manager);
- ret_hu_conv.ptrs_to.add(peer_manager);
- ret_hu_conv.ptrs_to.add(logger);
- ret_hu_conv.ptrs_to.add(scorer);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(persister); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(event_handler); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(chain_monitor); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_manager); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(peer_manager); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(scorer); };
return ret_hu_conv;
}
Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
- this.ptrs_to.add(this);
+ if (this != null) { this.ptrs_to.add(this); };
// Due to rust's strict-ownership memory model, in some cases we need to "move"
// an object to pass exclusive ownership to the function being called.
// In most cases, we avoid this being visible in GC'd languages by cloning the object
Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
- this.ptrs_to.add(this);
+ if (this != null) { this.ptrs_to.add(this); };
// Due to rust's strict-ownership memory model, in some cases we need to "move"
// an object to pass exclusive ownership to the function being called.
// In most cases, we avoid this being visible in GC'd languages by cloning the object