clone traits before passing to jcalls and map to human types
[ldk-java] / src / main / java / org / ldk / structs / SocketDescriptor.java
index f4956896545c94a77f9d217ccdb5d3505b802c5b..9670c9da7ea5d15f1951e5fdf4530407921c8cde 100644 (file)
@@ -22,7 +22,7 @@ public class SocketDescriptor extends CommonBase {
        public static interface SocketDescriptorInterface {
                long send_data(byte[] data, boolean resume_read);
                void disconnect_socket();
-               boolean eq(long other_arg);
+               boolean eq(SocketDescriptor other_arg);
                long hash();
        }
        private static class LDKSocketDescriptorHolder { SocketDescriptor held; }
@@ -37,7 +37,9 @@ public class SocketDescriptor extends CommonBase {
                                arg.disconnect_socket();
                        }
                        @Override public boolean eq(long other_arg) {
-                               boolean ret = arg.eq(other_arg);
+                               SocketDescriptor ret_hu_conv = new SocketDescriptor(null, other_arg);
+                               ret_hu_conv.ptrs_to.add(this);
+                               boolean ret = arg.eq(ret_hu_conv);
                                return ret;
                        }
                        @Override public long hash() {