Browse Source

call close() from the Node class's finalize method

Signed-off-by: Grant Limberg <[email protected]>
Grant Limberg 10 years ago
parent
commit
e0c8ddb65b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      java/src/com/zerotierone/sdk/Node.java

+ 5 - 0
java/src/com/zerotierone/sdk/Node.java

@@ -84,6 +84,11 @@ public class Node {
         }
         }
     }
     }
 
 
+    @Override
+    protected void finalize() {
+        close();
+    }
+
 	private native ResultCode processVirtualNetworkFrame(
 	private native ResultCode processVirtualNetworkFrame(
         long nodeId,
         long nodeId,
 		long now,
 		long now,