summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-07-15 00:08:45 +0200
committercyBerta <cyberta@riseup.net>2021-07-21 22:02:28 +0200
commita3ed9483391ef38ee6665be4e4fe25a71b4c83be (patch)
treebe75e1672b9691f8ca366de73024ca27e07e6885
parentb2705ea702a9eaa4a0f5566ed70cdfb4f41390d3 (diff)
always stop tor service connection immediately after we got the http tunnel port
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
index 15e77576..322bf1cd 100644
--- a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
+++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
@@ -168,7 +168,10 @@ public class ProviderAPI extends JobIntentService implements ProviderApiManagerB
getApplicationContext().startService(torServiceIntent);
}
- return torServiceConnection.torService.getHttpTunnelPort();
+ int tunnelPort = torServiceConnection.torService.getHttpTunnelPort();
+ torServiceConnection.close();
+ torServiceConnection = null;
+ return tunnelPort;
}
return -1;