From dc5338510457ace0bbd0b98b135e14be8e850ecf Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 14 Dec 2022 14:48:24 +0100 Subject: null explicitely service openvpn serviceconnections after they've been closed --- app/src/main/java/se/leap/bitmaskclient/eip/EIP.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient') diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java index b3efd21f..88cdc715 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -594,7 +594,7 @@ public final class EIP extends JobIntentService implements Observer { } public static class VoidVpnServiceConnection implements Closeable { - private final Context context; + private Context context; private ServiceConnection serviceConnection; private VoidVpnService voidVpnService; @@ -608,6 +608,9 @@ public final class EIP extends JobIntentService implements Observer { @Override public void close() { context.unbindService(serviceConnection); + serviceConnection = null; + voidVpnService = null; + context = null; } private void initSynchronizedServiceConnection(final Context context) throws InterruptedException { @@ -649,7 +652,7 @@ public final class EIP extends JobIntentService implements Observer { */ @WorkerThread public static class OpenVpnServiceConnection implements Closeable { - private final Context context; + private Context context; private ServiceConnection serviceConnection; private IOpenVPNServiceInternal service; @@ -686,6 +689,9 @@ public final class EIP extends JobIntentService implements Observer { @Override public void close() { context.unbindService(serviceConnection); + serviceConnection = null; + service = null; + context = null; } public IOpenVPNServiceInternal getService() { -- cgit v1.2.3