Fix leaking IntentReceiver for some reason

This commit is contained in:
Mygod
2018-03-09 00:11:06 -08:00
parent c2e8fd14ea
commit c9e8b53e20

View File

@@ -198,7 +198,7 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, VpnMonitor.Ca
}
/**
* startService 2nd stop, also called when VPN re-established
* startService 2nd stop
*/
private fun setup(ifname: String? = null, dns: List<InetAddress> = emptyList()) {
val matcher = patternNetworkInfo.matcher(loggerSu("dumpsys ${Context.WIFI_P2P_SERVICE}") ?: "")
@@ -343,6 +343,7 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, VpnMonitor.Ca
override fun onDestroy() {
if (status != Status.IDLE) binder.shutdown()
clean() // force clean to prevent leakage
super.onDestroy()
}
}