diff --git a/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala b/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala index 74fb80ec..ec2367a8 100644 --- a/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala +++ b/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala @@ -17,10 +17,7 @@ trait ServiceBoundContext extends Context { ServiceBoundContext.this.onServiceConnected() } override def onServiceDisconnected(name: ComponentName) { - if (callback != null) { - unregisterCallback - callback = null - } + unregisterCallback ServiceBoundContext.this.onServiceDisconnected() bgService = null }