Pedro Francisco de Sousa Neto
02/08/2023, 7:05 PMinit {
[...]
lifecycleOwner.lifecycle.addObserver(object : DefaultLifecycleObserver {
override fun onCreate(owner: LifecycleOwner) {
createScope()
}
override fun onDestroy(owner: LifecycleOwner) {
logger.debug("Closing scope: $_scope for $lifecycleOwner")
if (_scope?.closed == false) {
_scope?.close()
}
_scope = null
}
})
[...]
}
TO
internal fun LifecycleOwner.registerScopeForLifecycle(
scope: Scope
) {
lifecycle.addObserver(
object : DefaultLifecycleObserver {
override fun onDestroy(owner: LifecycleOwner) {
super.onDestroy(owner)
scope.close()
}
}
)
}
Crashes with ClosedKoinException
increased in our app with Koin 3.3.1
(with the TO/new code) that wasn’t happening with 3.1.6
(with FROM/old code).
I think this code change was the cause, but I’m not sure yet. We’re analyzing!
Thanks for attention!arnaud.giuliani
02/09/2023, 8:12 AMPedro Francisco de Sousa Neto
02/09/2023, 12:41 PMFragmentStateAdapter
.arnaud.giuliani
02/09/2023, 3:31 PM