From 0503eeac41566d58cb82d33dfd7cb07cd342d544 Mon Sep 17 00:00:00 2001 From: Mygod Date: Mon, 25 Apr 2016 12:53:38 +0800 Subject: [PATCH] Refine onServiceDisconnected --- .../scala/com/github/shadowsocks/ServiceBoundContext.scala | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 }