Browse Source

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 years ago
parent
commit
29007f5a95

+ 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) {