diff --git a/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala b/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala index 40ec6f3e..debd6cef 100644 --- a/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala +++ b/src/main/scala/com/github/shadowsocks/ServiceBoundContext.scala @@ -69,7 +69,9 @@ trait ServiceBoundContext extends Context with IBinder.DeathRecipient { unregisterCallback callback = null if (connection != null) { - unbindService(connection) + try unbindService(connection) catch { + case _: IllegalArgumentException => // ignore + } connection = null } if (binder != null) {