Fix monitor flush
This commit is contained in:
@@ -16,8 +16,7 @@ class IpLinkMonitor private constructor() : IpMonitor() {
|
||||
if (monitor == null) {
|
||||
monitor = IpLinkMonitor()
|
||||
instance = monitor
|
||||
}
|
||||
monitor.flushAsync()
|
||||
} else monitor.flushAsync()
|
||||
}
|
||||
fun unregisterCallback(owner: Any) = synchronized(this) {
|
||||
if (callbacks.remove(owner) == null || callbacks.isNotEmpty()) return@synchronized
|
||||
|
||||
@@ -28,9 +28,11 @@ class IpNeighbourMonitor private constructor() : IpMonitor() {
|
||||
if (monitor == null) {
|
||||
monitor = IpNeighbourMonitor()
|
||||
instance = monitor
|
||||
monitor.flushAsync()
|
||||
null
|
||||
} else monitor.neighbours.values
|
||||
} else {
|
||||
monitor.flushAsync()
|
||||
monitor.neighbours.values
|
||||
}
|
||||
}?.let { callback.onIpNeighbourAvailable(it) }
|
||||
fun unregisterCallback(callback: Callback) = synchronized(callbacks) {
|
||||
if (callbacks.remove(callback) == null) return@synchronized
|
||||
|
||||
Reference in New Issue
Block a user