Use AutoCloseable for structs named Locked*
[ldk-java] / src / main / java / org / ldk / structs / DataLossProtect.java
index 47f90cf9a0d95e91c8d3eec9a6992fd1eb143113..f4bf70f164b08645378e012209d111c574adc9ec 100644 (file)
@@ -7,7 +7,8 @@ public class DataLossProtect extends CommonBase {
        DataLossProtect(Object _dummy, long ptr) { super(ptr); }
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
-               bindings.DataLossProtect_free(ptr); super.finalize();
+               super.finalize();
+               bindings.DataLossProtect_free(ptr);
        }
 
        public DataLossProtect(DataLossProtect orig) {