Ganfra's review: revert change

This commit is contained in:
Benoit Marty 2019-06-10 16:58:48 +02:00
parent fa297a7b6a
commit 9772bbe157
1 changed files with 8 additions and 13 deletions

View File

@ -35,7 +35,6 @@ class RealmQueryLatch<E : RealmObject>(private val realmConfiguration: RealmConf
val realm = Realm.getInstance(realmConfiguration) val realm = Realm.getInstance(realmConfiguration)
val result = realmQueryBuilder(realm).findAllAsync() val result = realmQueryBuilder(realm).findAllAsync()
if (result.isEmpty()) {
result.addChangeListener(object : RealmChangeListener<RealmResults<E>> { result.addChangeListener(object : RealmChangeListener<RealmResults<E>> {
override fun onChange(t: RealmResults<E>) { override fun onChange(t: RealmResults<E>) {
if (t.isNotEmpty()) { if (t.isNotEmpty()) {
@ -45,10 +44,6 @@ class RealmQueryLatch<E : RealmObject>(private val realmConfiguration: RealmConf
} }
} }
}) })
} else {
realm.close()
latch.countDown()
}
} }
handler.post(runnable) handler.post(runnable)
latch.await() latch.await()