summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVpnService.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-02-25 14:15:33 +0100
committerArne Schwabe <arne@rfc2549.org>2013-02-25 14:15:33 +0100
commitbab6645cfb1eb9321e67482d862314a1dbf14f95 (patch)
tree1e0adc18cb0ba65f7b8f2cc8b3f32b5a0ca451ec /src/de/blinkt/openvpn/OpenVpnService.java
parentc078407422b7e10f5306b1763ba7986960e92d3a (diff)
Fix notificationalwaysvisible bug
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnService.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVpnService.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java
index 66ab9e30..cecae9d1 100644
--- a/src/de/blinkt/openvpn/OpenVpnService.java
+++ b/src/de/blinkt/openvpn/OpenVpnService.java
@@ -114,15 +114,16 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
private void endVpnService() {
mProcessThread=null;
OpenVPN.logBuilderConfig(null);
- OpenVPN.removeStateListener(this);
OpenVPN.removeByteCountListener(this);
unregisterNetworkStateReceiver();
ProfileManager.setConntectedVpnProfileDisconnected(this);
if(!mStarting) {
stopForeground(!mNotificationalwaysVisible);
- if( !mNotificationalwaysVisible)
+ if( !mNotificationalwaysVisible) {
stopSelf();
+ OpenVPN.removeStateListener(this);
+ }
}
}
@@ -351,6 +352,8 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
if (mNetworkStateReceiver!= null) {
this.unregisterReceiver(mNetworkStateReceiver);
}
+ // Just in case unregister for state
+ OpenVPN.removeStateListener(this);
}