Skip to content

Commit

Permalink
Copied the user results from Realm to an unmanaged list, since the Re…
Browse files Browse the repository at this point in the history
…almResults are unusable if the instance gets closed.
  • Loading branch information
roughike committed Feb 3, 2017
1 parent 7b92f3c commit 347c7fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ class RealmUserRepository : UserRepository {

override fun getAll(): List<User> = with(Realm.getDefaultInstance()) {
val all = where(User::class.java).findAll()
close()
val copy = copyFromRealm(all)

return@with all
close()
return@with copy
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.codemate.koffeemate.di.components

import com.codemate.koffeemate.di.modules.*
import com.codemate.koffeemate.ui.userselector.UserSelectorActivity
import com.codemate.koffeemate.ui.userselector.UserSelectorFragment
import dagger.Component
import javax.inject.Singleton
Expand Down

0 comments on commit 347c7fd

Please sign in to comment.