Commit bbb62be4 authored by Max Lv's avatar Max Lv

fix a race condition

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