Commit 9620f209 authored by Mygod's avatar Mygod

Suppress unlinkToDeath failures

parent 200e6888
......@@ -142,7 +142,9 @@ class ShadowsocksConnection(private val handler: Handler = Handler(),
context.unbindService(this)
} catch (_: IllegalArgumentException) { } // ignore
connectionActive = false
if (listenForDeath) binder?.unlinkToDeath(this, 0)
if (listenForDeath) try {
binder?.unlinkToDeath(this, 0)
} catch (_: NoSuchElementException) { }
binder = null
try {
service?.stopListeningForBandwidth(serviceCallback)
......
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