fix receiver leak
This commit is contained in:
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()
|
||||
|
||||
Reference in new issue
Block a user