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;
|
||||
}
|
||||
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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,8 +215,15 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
|
|||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.d(TAG,"closing interface, destroying VPN interface");
|
||||
|
||||
if (mInterface != null)
|
||||
{
|
||||
mInterface.close();
|
||||
mInterface = null;
|
||||
}
|
||||
|
||||
Tun2Socks.Stop();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Reference in New Issue