浏览代码

clear existing channels when load() is called

The Application object may not have been freed between finishing
activities and starting the next one. In this case, the stale channels
will still be present in the repository, causing a crash.
Peter Cai 3 年之前
父节点
当前提交
29007f5a95
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      app/src/main/java/im/angry/openeuicc/core/omapi/OmapiEuiccChannelRepository.kt

+ 1 - 0
app/src/main/java/im/angry/openeuicc/core/omapi/OmapiEuiccChannelRepository.kt

@@ -46,6 +46,7 @@ class OmapiEuiccChannelRepository(private val context: Context) : EuiccChannelRe
     }
 
     override suspend fun load() {
+        channels.clear()
         val service = connectSEService()
 
         for (slotId in 1..3) {