Refine callback handling
This commit is contained in:
@@ -476,19 +476,13 @@ class ShadowsocksNatService extends BaseService {
|
||||
// reset NAT
|
||||
killProcesses()
|
||||
|
||||
// stop the service if no callback registered
|
||||
if (getCallbackCount == 0) {
|
||||
stopSelf()
|
||||
}
|
||||
// stop the service if nothing has bound to it
|
||||
stopSelf()
|
||||
|
||||
// change the state
|
||||
changeState(State.STOPPED)
|
||||
}
|
||||
|
||||
override def stopBackgroundService() {
|
||||
stopSelf()
|
||||
}
|
||||
|
||||
override def getTag = TAG
|
||||
override def getServiceMode = Mode.NAT
|
||||
override def getContext = getBaseContext
|
||||
|
||||
Reference in New Issue
Block a user