cleanup code
This commit is contained in:
3 files changed
+4
-7
No files matched your search
@@ -35,12 +35,11 @@ class ClashService : BaseService() {
|
||||
|
||||
runtime.install(ReloadModule(service)) {
|
||||
onLoaded {
|
||||
if ( it != null ) {
|
||||
if (it != null) {
|
||||
reason = it.message
|
||||
|
||||
stopSelf()
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
broadcastProfileLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,14 +48,13 @@ class TunService : VpnService(), CoroutineScope by MainScope() {
|
||||
|
||||
runtime.install(ReloadModule(service)) {
|
||||
onLoaded {
|
||||
if ( it != null ) {
|
||||
if (it != null) {
|
||||
reason = it.message
|
||||
|
||||
stopSelf()
|
||||
|
||||
TunModule.requestStop()
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
broadcastProfileLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.github.kr328.clash.service.data.ClashDatabase
|
||||
import com.github.kr328.clash.service.util.resolveBase
|
||||
import com.github.kr328.clash.service.util.resolveProfile
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import java.lang.NullPointerException
|
||||
|
||||
class ReloadModule(private val context: Context) : Module() {
|
||||
override val receiveBroadcasts: Set<String>
|
||||
|
||||
Reference in new issue
Block a user