Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rorbech committed Nov 2, 2023
1 parent f3e4ce3 commit f44046a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ actual object RealmInterop {
// but requires opting in for @ExperimentalStdlibApi, and have really gotten it to play
// for default cases.
realm_wrapper.realm_config_set_scheduler(config.cptr(), scheduler.cptr())
scheduler.release()

val realmPtr = CPointerWrapper<LiveRealmT>(realm_wrapper.realm_open(config.cptr()))
// Ensure that we can read version information, etc.
Expand All @@ -532,7 +531,7 @@ actual object RealmInterop {
// If there is no notification dispatcher use the default scheduler.
// Re-verify if this is actually needed when notification scheduler is fully in place.
val scheduler = checkedPointerResult(realm_wrapper.realm_scheduler_make_default())
return CPointerWrapper<RealmSchedulerT>(scheduler, managed = false)
return CPointerWrapper<RealmSchedulerT>(scheduler)
}

actual fun realm_create_scheduler(dispatcher: CoroutineDispatcher): RealmSchedulerPointer {
Expand Down Expand Up @@ -588,7 +587,7 @@ actual object RealmInterop {

scheduler.set_scheduler(capi_scheduler)

return CPointerWrapper<RealmSchedulerT>(capi_scheduler, managed = false)
return CPointerWrapper<RealmSchedulerT>(capi_scheduler)
}

actual fun realm_open_synchronized(config: RealmConfigurationPointer): RealmAsyncOpenTaskPointer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class CinteropTest {
)
RealmInterop.realm_config_set_schema_version(nativeConfig, 1)
RealmInterop.realm_create_scheduler()
.let { scheduler ->
.run { scheduler ->
val (realm, fileCreated) = RealmInterop.realm_open(nativeConfig, scheduler)
assertEquals(1L, RealmInterop.realm_get_num_classes(realm))
RealmInterop.realm_close(realm)
Expand Down

0 comments on commit f44046a

Please sign in to comment.