fix receiver leak

This commit is contained in:
Kr328 committed 2020-02-22 21:43:28 +08:00
1 parent ea3aee0883
commit 7ab7c8abee
1 file changed
+3
@@ -6,6 +6,7 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.PowerManager
import androidx.core.content.contentValuesOf
import androidx.core.content.getSystemService
import com.github.kr328.clash.core.Clash
import com.github.kr328.clash.core.utils.Log
@@ -102,6 +103,8 @@ class ClashCore(private val service: Service): CoroutineScope by MainScope() {
fun destroy() {
cancel()
service.unregisterReceiver(receivers)
reloadChannel.close()
notification.destroy()