Thread
#compose
    Bryan Lee

    Bryan Lee

    2 years ago
    Do we have to manage the destruction of composable views ourselves as of now? I consistently get OutOfMemoryError after opening a list of items X amount of times
    Adam Powell

    Adam Powell

    2 years ago
    unfortunately for now yes, depending on how you constructed things. If you do a
    container.setContent {}
    when you dispose of a compose subhierarchy it should clear things out. I think the activity variant does this automatically but I don't recall
    (that's specifically a
    setContent
    with an empty content block)
    Bryan Lee

    Bryan Lee

    2 years ago
    Sorry, could you elaborate on how to dispose of a compose sub-hierarchy? Where would I do this? one of the activities/fragments lifecycle functions?
    Adam Powell

    Adam Powell

    2 years ago
    if you ctrl+click into the source for the
    setContent
    extensions you can see what a bunch of them do under the hood to build the composition; the dispose helpers all basically just recompose with empty content to clear things
    Bryan Lee

    Bryan Lee

    2 years ago
    oo gotcha thanks~
    Adam Powell

    Adam Powell

    2 years ago
    we still have some API cleanup to do around this for sure 🙂