Fix incorrect shutdown order

This commit is contained in:
Mygod
2019-09-19 11:37:51 +08:00
parent 95ddd5c2d5
commit ceef7f3062

View File

@@ -108,8 +108,8 @@ class TetheringService : IpNeighbourMonitoringService(), CoroutineScope {
override fun onDestroy() { override fun onDestroy() {
launch { launch {
downstreams.values.forEach { it.destroy() } // force clean to prevent leakage
unregisterReceiver() unregisterReceiver()
downstreams.values.forEach { it.destroy() } // force clean to prevent leakage
cancel() cancel()
dispatcher.close() dispatcher.close()
} }