[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / Persister.java
index 6329303504b14cc05730bba5d85bdde0fc395fd4..3cdf7360d3957a82df5dec0de1826cf9444affd2 100644 (file)
@@ -23,7 +23,19 @@ public class Persister extends CommonBase {
        protected void finalize() throws Throwable {
                if (ptr != 0) { bindings.Persister_free(ptr); } super.finalize();
        }
-
+       /**
+        * Destroys the object, freeing associated resources. After this call, any access
+        * to this object may result in a SEGFAULT or worse.
+        *
+        * You should generally NEVER call this method. You should let the garbage collector
+        * do this for you when it finalizes objects. However, it may be useful for types
+        * which represent locks and should be closed immediately to avoid holding locks
+        * until the GC runs.
+        */
+       public void destroy() {
+               if (ptr != 0) { bindings.Persister_free(ptr); }
+               ptr = 0;
+       }
        public static interface PersisterInterface {
                /**
                 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.