mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Make sure the live timeline is destroyed before clearing a room's cache (#4515)
* Make sure the live timeline is destroyed before clearing a room's cache According to the SDK team, having a live timeline could lead to DB issues. * Try to destroy all room and list item references when the `RustRoomFactory` is destroyed It may also have some effect on DB corruption issues we've seen
This commit is contained in:
committed by
GitHub
parent
d7ca529db1
commit
b2791d5aad
+4
@@ -81,6 +81,10 @@ class RustRoomFactory(
|
||||
withContext(NonCancellable + dispatcher) {
|
||||
mutex.withLock {
|
||||
Timber.d("Destroying room factory")
|
||||
cache.snapshot().values.forEach { (listItem, innerRoom) ->
|
||||
innerRoom.destroy()
|
||||
listItem.destroy()
|
||||
}
|
||||
cache.evictAll()
|
||||
isDestroyed = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user