From 2d5ee42894fc83659faaf5fb57b7ffd4c47ebe5c Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Thu, 19 Mar 2015 10:28:49 -0400 Subject: [PATCH] calling stop() makes tun2socks crash since VPN is still enabled --- src/org/torproject/android/vpn/OrbotVpnService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/org/torproject/android/vpn/OrbotVpnService.java b/src/org/torproject/android/vpn/OrbotVpnService.java index 46c6efc4..93a4d0ad 100644 --- a/src/org/torproject/android/vpn/OrbotVpnService.java +++ b/src/org/torproject/android/vpn/OrbotVpnService.java @@ -229,18 +229,23 @@ public class OrbotVpnService extends VpnService implements Handler.Callback { { Log.d(TAG,"closing interface, destroying VPN interface"); + //Tun2Socks.Stop(); + if (mInterface != null) { mInterface.close(); mInterface = null; } - Tun2Socks.Stop(); } catch (Exception e) { Log.d(TAG,"error stopping tun2socks",e); } + catch (Error e) + { + Log.d(TAG,"error stopping tun2socks",e); + } } }.start(); super.onRevoke();