Refine callback handling

This commit is contained in:
Mygod
2015-12-26 23:10:54 +08:00
parent 179aab8094
commit 51ceb3dac5
3 changed files with 9 additions and 31 deletions
@@ -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