make sure receiver unregisters when destroyed
This commit is contained in:
parent
2bd5614210
commit
b322e530da
|
@ -428,6 +428,14 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
|
||||||
|
try {
|
||||||
|
unregisterReceiver(mNetworkStateReceiver);
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException iae)
|
||||||
|
{
|
||||||
|
//not registered yet
|
||||||
|
}
|
||||||
|
|
||||||
stopTor();
|
stopTor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -476,13 +484,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
|
||||||
clearNotifications();
|
clearNotifications();
|
||||||
sendCallbackStatus(STATUS_OFF);
|
sendCallbackStatus(STATUS_OFF);
|
||||||
|
|
||||||
try {
|
|
||||||
unregisterReceiver(mNetworkStateReceiver);
|
|
||||||
}
|
|
||||||
catch (IllegalArgumentException iae)
|
|
||||||
{
|
|
||||||
//not registered yet
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void killAllDaemons() throws Exception {
|
private void killAllDaemons() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue