diff options
author | cyBerta <cyberta@riseup.net> | 2024-08-18 10:36:40 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2024-08-18 10:36:40 +0200 |
commit | c623c3fe3611ece78e914483ac1d52a34115032c (patch) | |
tree | dbc8373e0fee72657c04782aeecf2ddabf0e4e2d | |
parent | 2f0c163b3ba9520e4fe239d07fcf8ace376bfd00 (diff) |
improve pairity between registering and unregistering the obfsvpn event logger
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsvpnClient.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsvpnClient.java b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsvpnClient.java index bf030a0f..6ee49951 100644 --- a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsvpnClient.java +++ b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsvpnClient.java @@ -40,17 +40,19 @@ public class ObfsvpnClient implements EventLogger { try { Log.d(TAG, obfsvpnConfig.toString()); client = Client.newFFIClient(obfsvpnConfig.toString()); - client.setEventLogger(this); } catch (Exception e) { throw new IllegalStateException(e); } } public int start() { - synchronized (LOCK) { new Thread(() -> { try { + if (client.isStarted()) { + return; + } + client.setEventLogger(this); client.start(); } catch (Exception e) { e.printStackTrace(); |