https://kotlinlang.org logo
Title
j

Ji Sungbin

05/21/2022, 8:00 AM
Wouldn’t memory leak if Context is provided as CompositionLocal like LocalContext(activity context by owner.context)? CompositionLocal values store in SlotTable, I know that SlotTable is just a linear array. In the case of an activity context, entering the array is a potential memory leak. Let me know if I’m misunderstood.
👍 3
a

Albert Chang

05/21/2022, 1:11 PM
When the activity is destroyed, the composition tied to the
ComposeView
in the activity, which includes the slot table, will be disposed.
:thank-you: 1
j

Ji Sungbin

05/21/2022, 1:52 PM
oh, I didn’t see dispose. really thanks.
👍 2