diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/Subrouting.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/Subrouting.kt index 45c11a05..25598b8f 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/Subrouting.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/Subrouting.kt @@ -62,8 +62,12 @@ class Subrouting(private val parent: Routing, priority: Int, val upstream: Strin init { Timber.d("Subrouting initialized from %s to %s", parent.downstream, upstream) - Timber.d(Thread.currentThread().stackTrace.joinToString("\n")) - IpNeighbourMonitor.registerCallback(this) + try { + IpNeighbourMonitor.registerCallback(this) + } catch (e: Exception) { + close() + throw e + } } /** @@ -72,7 +76,6 @@ class Subrouting(private val parent: Routing, priority: Int, val upstream: Strin override fun close() { IpNeighbourMonitor.unregisterCallback(this) Timber.d("Subrouting closed from %s to %s", parent.downstream, upstream) - Timber.d(Thread.currentThread().stackTrace.joinToString("\n")) } override fun onIpNeighbourAvailable(neighbours: List) = synchronized(parent) {