From 4dd2f6ba1268dd4f122722d9f9e857193eb90965 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 14 Dec 2022 02:01:28 +0100 Subject: force nulling context after TorServiceConnection.close() --- .../java/se/leap/bitmaskclient/tor/TorServiceConnection.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'app/src/main/java/se') diff --git a/app/src/main/java/se/leap/bitmaskclient/tor/TorServiceConnection.java b/app/src/main/java/se/leap/bitmaskclient/tor/TorServiceConnection.java index dbfce2b5..87d3cad4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/tor/TorServiceConnection.java +++ b/app/src/main/java/se/leap/bitmaskclient/tor/TorServiceConnection.java @@ -15,6 +15,9 @@ package se.leap.bitmaskclient.tor; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +import static se.leap.bitmaskclient.base.utils.ConfigHelper.ensureNotOnMainThread; + import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -30,13 +33,9 @@ import java.io.Closeable; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; -import se.leap.bitmaskclient.providersetup.ProviderAPI; - -import static se.leap.bitmaskclient.base.utils.ConfigHelper.ensureNotOnMainThread; - public class TorServiceConnection implements Closeable { private static final String TAG = TorServiceConnection.class.getSimpleName(); - private final Context context; + private Context context; private ServiceConnection serviceConnection; private TorService torService; @@ -50,6 +49,9 @@ public class TorServiceConnection implements Closeable { @Override public void close() { context.unbindService(serviceConnection); + context = null; + serviceConnection = null; + torService = null; } private void initSynchronizedServiceConnection(final Context context) throws InterruptedException { -- cgit v1.2.3