防止多次初始化
This commit is contained in:
parent
dd8df63b01
commit
f7b024f6da
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue