commit 1e5651eec39463ef572ae4aa569ccf3b95a5cc91 Author: Nathan Freitas nathan@freitas.net Date: Sat Feb 14 00:44:02 2015 -0500
improve VPN clean-up code --- src/org/torproject/android/vpn/OrbotVpnService.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/org/torproject/android/vpn/OrbotVpnService.java b/src/org/torproject/android/vpn/OrbotVpnService.java index 7919b07..44a2723 100644 --- a/src/org/torproject/android/vpn/OrbotVpnService.java +++ b/src/org/torproject/android/vpn/OrbotVpnService.java @@ -137,14 +137,8 @@ public class OrbotVpnService extends VpnService implements Handler.Callback { mProxyServer = null; } if (mInterface != null){ - try { - Log.d(TAG,"closing interface, destroying VPN interface"); - mInterface.close(); - mInterface = null; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + onRevoke(); + } }
@@ -222,7 +216,14 @@ public class OrbotVpnService extends VpnService implements Handler.Callback { { try { - mInterface.close(); + Log.d(TAG,"closing interface, destroying VPN interface"); + + if (mInterface != null) + { + mInterface.close(); + mInterface = null; + } + Tun2Socks.Stop(); } catch (Exception e)
tor-commits@lists.torproject.org