fix a race condition

This commit is contained in:
Max Lv
2015-09-28 21:05:41 +08:00
parent b272d7ab71
commit bbb62be458
@@ -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
}
handler.removeCallbacksAndMessages(null)
}
def copyToSystem() {