Commit 2bf44c7e authored by Max Lv's avatar Max Lv

fix some issues

parent 19267732
...@@ -106,8 +106,8 @@ trait BaseService { ...@@ -106,8 +106,8 @@ trait BaseService {
override def run() { override def run() {
if (state != s) { if (state != s) {
val n = callbacks.beginBroadcast() val n = callbacks.beginBroadcast()
for (i <- 0 to n -1) { for (i <- 0 to n - 1) {
callbacks.getBroadcastItem(i).stateChanged(s, msg) callbacks.getBroadcastItem(i).stateChanged(s, msg.substring(0, 64))
} }
callbacks.finishBroadcast() callbacks.finishBroadcast()
state = s state = s
......
...@@ -606,7 +606,11 @@ class Shadowsocks ...@@ -606,7 +606,11 @@ class Shadowsocks
def deattachService() { def deattachService() {
if (bgService != null) { if (bgService != null) {
try {
bgService.unregisterCallback(callback) bgService.unregisterCallback(callback)
} catch {
case ignored: RemoteException => // Nothing
}
unbindService(connection) unbindService(connection)
bgService = null bgService = null
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment