Dispose для EncryptedStorage

This commit is contained in:
Roman Pytkov
2025-01-05 03:44:53 +03:00
parent df3fe696ef
commit abbaa62412
4 changed files with 30 additions and 10 deletions

View File

@@ -22,7 +22,13 @@ class UnlockManager(dao: StorageKeyDao, ioDispatcher: CoroutineDispatcher): IUnl
TODO("Not yet implemented")
}
override fun close(storage: IStorage) {
TODO("Not yet implemented")
override fun close(uuid: UUID) {
val enc = _openedStorages.value[uuid]
if(enc == null)
return
_openedStorages.value = _openedStorages.value.toMutableMap().apply {
remove(uuid)
}
enc.dispose()
}
}