mirror of
https://github.com/lizongying/my-tv.git
synced 2026-10-26 22:26:29 +08:00
防止多次初始化
This commit is contained in:
@@ -9,7 +9,15 @@ object TVList {
|
||||
lateinit var list: Map<String, List<TV>>
|
||||
|
||||
fun init(context: Context){
|
||||
setupTV(context)
|
||||
if(::list.isInitialized){
|
||||
return
|
||||
}
|
||||
synchronized(this){
|
||||
if(::list.isInitialized){
|
||||
return
|
||||
}
|
||||
list = setupTV(context)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user