mirror of
https://gitlab.com/Monsterovich/lanemu.git
synced 2024-07-07 06:01:16 +02:00
Let the OS close the descriptors
This commit is contained in:
parent
a7fa3fdf98
commit
3010a90af5
|
@ -62,13 +62,14 @@ public class VPNConnector implements Runnable {
|
|||
tuntap = TunTap.createTunTap();
|
||||
router = null;
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
|
||||
public void run() {
|
||||
if (tuntap != null) {
|
||||
tuntap.close();
|
||||
}
|
||||
}
|
||||
}));
|
||||
// fixme: Oracle JVM crashes when executing this code (OpenJDK works fine)
|
||||
// Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
|
||||
// public void run() {
|
||||
// if (tuntap != null) {
|
||||
// tuntap.close();
|
||||
// }
|
||||
// }
|
||||
// }));
|
||||
|
||||
thread = new Thread(this, "VPNConnector");
|
||||
thread.start();
|
||||
|
|
Loading…
Reference in a new issue