Temp fix Realm crash

This commit is contained in:
ariskotsomitopoulos 2022-03-03 17:04:08 +02:00
parent e4282e5f29
commit 39bd437f75

View file

@ -66,7 +66,12 @@ internal class RealmSendingEventsDataSource(
private fun updateFrozenResults(sendingEvents: RealmList<TimelineEventEntity>?) {
// Makes sure to close the previous frozen realm
frozenSendingTimelineEvents?.realm?.close()
// TODO find a better way to avoid thread timeline crash:
// - Make RealmSendingEventsDataSource Singleton
// - Do not initialize RealmSendingEventsDataSource when we are in a thread timeline while
// we already have an instance from the main timeline
// - Close Main timeline before Opening a thread timeline
// frozenSendingTimelineEvents?.realm?.close()
frozenSendingTimelineEvents = sendingEvents?.freeze()
}