Commit 24510cc2 authored by Mygod's avatar Mygod

Fix more race conditions in ShadowsocksConnection

parent 244f9978
......@@ -108,14 +108,14 @@ class ShadowsocksConnection(private val handler: Handler = Handler(),
override fun onServiceDisconnected(name: ComponentName?) {
unregisterCallback()
callback!!.onServiceDisconnected()
callback?.onServiceDisconnected()
service = null
binder = null
}
override fun binderDied() {
service = null
handler.post(callback!!::onBinderDied)
callback?.also { handler.post(it::onBinderDied) }
}
private fun unregisterCallback() {
......
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