dave08
01/01/2025, 9:55 AMYoussef Shoaib [MOD]
01/01/2025, 10:36 AMresourceScope {
val mother = install(...)
val child = makeChild()
mother.registerChild(child)
onRelease { mother.unregisterChild(child) }
}
The child will be unregistered first, and then the mother resource will get closed downdave08
01/01/2025, 10:40 AMYoussef Shoaib [MOD]
01/01/2025, 10:41 AMdave08
01/01/2025, 10:43 AMresourceScope {
val mother = install(...)
val child = makeChild()
mother.registerChild(child)
val child1 = makeChild1()
mother.registerChild(child1)
...
onRelease {
mother.unregisterChild(child)
mother.unregisterChild(child1)
...
}
}
I'd like to have each child manage itself, and compose with the "mother"Youssef Shoaib [MOD]
01/01/2025, 10:45 AMmakeChild
take in the ResourceScope, and thus the child will be closed. Then, have registerChild
also take it in and automatically unregister the child too.dave08
01/01/2025, 10:50 AMYoussef Shoaib [MOD]
01/01/2025, 11:12 AMonRelease
does that, but there's also onClosed
I think which comes from AutoCloseableScope
(which ResourceScope
inherits)dave08
01/01/2025, 11:46 AMdave08
01/02/2025, 2:21 PMdave08
01/02/2025, 2:30 PMfixBehindLiveWindowPlayerListener
and imaAdsLoader
to handle their own lifecycle, also I'd only like to initialize an imaAdsLoader if playAudioAds is true...dave08
01/02/2025, 3:06 PM