]> git.bitcoin.ninja Git - ldk-java/blobdiff - java_strings.py
Update CI references to LDK 0.0.124 drop stale memchr pins
[ldk-java] / java_strings.py
index c99e83129b4bf21f68d72ae54af127dc255c94c4..7e35d17529d0e8ea127c25e104b0f73996a8f3da 100644 (file)
@@ -1418,6 +1418,9 @@ import javax.annotation.Nullable;
         java_hu_struct += "\tprotected void finalize() throws Throwable {\n"
         java_hu_struct += "\t\tif (ptr != 0) { bindings." + struct_name.replace("LDK","") + "_free(ptr); } super.finalize();\n"
         java_hu_struct += "\t}\n\n"
+        java_hu_struct += "\tprotected void force_free() {\n" # Used by NioPeerHandler
+        java_hu_struct += "\t\tif (ptr != 0) { bindings." + struct_name.replace("LDK","") + "_free(ptr); ptr = 0; }\n"
+        java_hu_struct += "\t}\n\n"
         java_hu_struct += "\tstatic " + human_ty + " constr_from_ptr(long ptr) {\n"
         java_hu_struct += "\t\tif (bindings." + struct_name.replace("LDK", "") + "_is_ok(ptr)) {\n"
         java_hu_struct += "\t\t\treturn new " + human_ty + "_OK(null, ptr);\n"