Skip to content

Commit

Permalink
move event
Browse files Browse the repository at this point in the history
  • Loading branch information
clementetb committed Sep 15, 2023
1 parent ef03369 commit 58b8b3f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal abstract class LiveRealm(
* [gcTrackedSnapshot] then the old reference will be closed, allowing Core to release the
* underlying resources of the no-longer referenced version.
*/
private val _snapshot: AtomicRef<FrozenRealmReference> = atomic(realmReference.snapshot(owner))
private val _snapshot: AtomicRef<FrozenRealmReference> = atomic(realmReference.snapshot(owner).also { onChange() })
/**
* Flag used to control whether to close or track the [_snapshot] when advancing to a newer
* version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ internal class SuspendableNotifier(
}
}

override val realmInitializer = lazy<LiveRealm> { NotifierRealm().also { onChange() } }
override val realmInitializer = lazy<LiveRealm> { NotifierRealm() }
// Must only be accessed from the dispatchers thread
override val realm: LiveRealm by realmInitializer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal class SuspendableWriter(
}

override val realmInitializer: Lazy<WriterRealm> = lazy {
WriterRealm().also { onChange() }
WriterRealm()
}

// Must only be accessed from the dispatchers thread
Expand Down

0 comments on commit 58b8b3f

Please sign in to comment.