calling stop() makes tun2socks crash since VPN is still enabled

This commit is contained in:
Nathan Freitas 2015-03-19 10:28:49 -04:00
parent cae2c7c157
commit 2d5ee42894
1 changed files with 6 additions and 1 deletions

View File

@ -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();