stop the service in time

This commit is contained in:
Max Lv
2014-02-24 12:41:14 +08:00
parent 4bbbc6b730
commit a21a4d24fa
5 changed files with 44 additions and 4 deletions
@@ -526,6 +526,16 @@ class ShadowsocksNatService extends Service with BaseService {
// reset NAT
killProcesses()
// stop the service if no callback registered
if (callbackCount == 0) {
stopSelf()
}
}
override def stopBackgroundService() {
stopRunner()
stopSelf()
}
override def getTag = TAG