improve VPN clean-up code
This commit is contained in:
parent
a2662c325d
commit
1e5651eec3
|
@ -137,14 +137,8 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
|
||||||
mProxyServer = null;
|
mProxyServer = null;
|
||||||
}
|
}
|
||||||
if (mInterface != null){
|
if (mInterface != null){
|
||||||
try {
|
onRevoke();
|
||||||
Log.d(TAG,"closing interface, destroying VPN interface");
|
|
||||||
mInterface.close();
|
|
||||||
mInterface = null;
|
|
||||||
} catch (IOException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +216,14 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
mInterface.close();
|
Log.d(TAG,"closing interface, destroying VPN interface");
|
||||||
|
|
||||||
|
if (mInterface != null)
|
||||||
|
{
|
||||||
|
mInterface.close();
|
||||||
|
mInterface = null;
|
||||||
|
}
|
||||||
|
|
||||||
Tun2Socks.Stop();
|
Tun2Socks.Stop();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
Loading…
Reference in New Issue