fix some issues
This commit is contained in:
@@ -106,8 +106,8 @@ trait BaseService {
|
||||
override def run() {
|
||||
if (state != s) {
|
||||
val n = callbacks.beginBroadcast()
|
||||
for (i <- 0 to n -1) {
|
||||
callbacks.getBroadcastItem(i).stateChanged(s, msg)
|
||||
for (i <- 0 to n - 1) {
|
||||
callbacks.getBroadcastItem(i).stateChanged(s, msg.substring(0, 64))
|
||||
}
|
||||
callbacks.finishBroadcast()
|
||||
state = s
|
||||
|
||||
@@ -606,7 +606,11 @@ class Shadowsocks
|
||||
|
||||
def deattachService() {
|
||||
if (bgService != null) {
|
||||
bgService.unregisterCallback(callback)
|
||||
try {
|
||||
bgService.unregisterCallback(callback)
|
||||
} catch {
|
||||
case ignored: RemoteException => // Nothing
|
||||
}
|
||||
unbindService(connection)
|
||||
bgService = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user