mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 12:00:03 +03:00
No need to freeze empty RealmList
This was the source of growing memory usage. Non empty result are supposed to be temporary, so this is fine.
This commit is contained in:
parent
b3a50d4f68
commit
0b5e0fea72
1 changed files with 2 additions and 1 deletions
|
@ -72,7 +72,8 @@ internal class RealmSendingEventsDataSource(
|
|||
if (frozenSendingTimelineEvents?.isValid == true) {
|
||||
frozenSendingTimelineEvents?.realm?.close()
|
||||
}
|
||||
frozenSendingTimelineEvents = sendingEvents?.freeze()
|
||||
// Do not freeze empty list
|
||||
frozenSendingTimelineEvents = sendingEvents?.takeIf { it.isNotEmpty() }?.freeze()
|
||||
}
|
||||
|
||||
override fun buildSendingEvents(): List<TimelineEvent> {
|
||||
|
|
Loading…
Add table
Reference in a new issue