fix a race condition
This commit is contained in:
@@ -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
|
|||||||
|
|
||||||
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
|
|||||||
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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user