summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-12-14 02:01:28 +0100
committercyBerta <cyberta@riseup.net>2022-12-15 23:57:15 +0100
commit4dd2f6ba1268dd4f122722d9f9e857193eb90965 (patch)
tree9857506eb3c3f5fe28b074b83618f26523b9a0f0 /app
parent628f2466d6c351357ee7f1fd6623f750d1d6f46a (diff)
force nulling context after TorServiceConnection.close()
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tor/TorServiceConnection.java12
1 files changed, 7 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>.
*/
+
+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 {