We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
DisposableEffect
SaveableStateRegistry
1 parent 012b425 commit 5aaf70dCopy full SHA for 5aaf70d
1 file changed
compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/platform/CompositionLocals.skiko.kt
@@ -88,7 +88,11 @@ internal fun ProvidePlatformCompositionLocals(
88
savedStateRegistryOwner = platformContext.architectureComponentsOwner.savedStateRegistryOwner
89
)
90
}
91
- DisposableEffect(platformContext) { onDispose { saveableStateRegistry.dispose() } }
+ DisposableEffect(platformContext) {
92
+ //save a reference to dispose of a right object
93
+ val registry = saveableStateRegistry
94
+ onDispose { registry.dispose() }
95
+ }
96
97
// TODO: https://youtrack.jetbrains.com/issue/CMP-9752/Properly-implement-HostDefaultProvider-and-LocalHostDefaultProvider-for-CMP
98
val hostDefaultProvider = remember(platformContext) {
0 commit comments