Commit bbb62be4 authored by Max Lv's avatar Max Lv

fix a race condition

parent b272d7ab
......@@ -250,7 +250,7 @@ class Shadowsocks
private lazy val application = getApplication.asInstanceOf[ShadowsocksApplication]
var handler: Handler = null
var handler = new Handler()
def isSinglePane: Boolean = {
if (singlePane == -1) {
......@@ -479,8 +479,6 @@ class Shadowsocks
super.onCreate(savedInstanceState)
handler = new Handler()
addPreferencesFromResource(R.xml.pref_all)
// Update the profile
......@@ -901,10 +899,7 @@ class Shadowsocks
deattachService()
unregisterReceiver(preferenceReceiver)
new BackupManager(this).dataChanged()
if (handler != null) {
handler.removeCallbacksAndMessages(null)
handler = null
}
}
def copyToSystem() {
......
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