From 4a24b1600815cd63039dfbb88df0c70668fdb5ce Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 25 Jan 2018 20:22:14 -0800 Subject: [PATCH] Kill old monitor silently --- .../main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt index ec2f1a19..37d84c22 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt @@ -29,7 +29,8 @@ class IpNeighbourMonitor private constructor() { if (!callbacks.remove(callback) || callbacks.isNotEmpty()) return val monitor = instance ?: return instance = null - monitor.monitor?.destroy() + val process = monitor.monitor + if (process != null) thread(TAG + "-killer") { process.destroy() } } /**