[Java] Update auto-generated Java structs
[ldk-java] / src / main / java / org / ldk / structs / LockableScore.java
index 7716950af939df3dac28f489a0cdce1dbc47cf12..96617a1efb765f90143ce16481268dfe6a3b0aef 100644 (file)
@@ -43,8 +43,9 @@ public class LockableScore extends CommonBase {
                impl_holder.held = new LockableScore(new bindings.LDKLockableScore() {
                        @Override public long lock() {
                                Score ret = arg.lock();
+                               Reference.reachabilityFence(arg);
                                long result = ret == null ? 0 : ret.ptr;
-                               impl_holder.held.ptrs_to.add(ret);
+                               if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); };
                                return result;
                        }
                });
@@ -58,7 +59,7 @@ public class LockableScore extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                Score ret_hu_conv = new Score(null, ret);
-               ret_hu_conv.ptrs_to.add(this);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }