coil-kt/coil

IOS App crashes with `didReceiveMemoryWarning`

Aberta

#2.765 aberto em 28 de dez. de 2024

 (7 comentários) (0 reação) (0 responsável)Kotlin (757 forks)batch import
help wanted

Métricas do repositório

Stars
 (11.779 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Describe the bug iOS App Crashes when a LazyColumn is scrolled fast. I have a lazy column with around 500+ items in it. If i scroll the lazy column fast or flick too much, iOS App crashes with didReceiveMemoryWarning error logged in XCode. Android app on the other hand works perfectly fine.

To Reproduce

@Composable
fun MyImage(
    url: String,
    placeholder: Painter? = null,
    error: Painter? = placeholder,
    contentDescription: String,
    modifier: Modifier = Modifier,
    contentScale: ContentScale = ContentScale.Fit
) {
    setSingletonImageLoaderFactory { context ->
        ImageLoader.Builder(context)
            .crossfade(true)
            .coroutineContext(Dispatchers.Default)
            .build()
    }
    AsyncImage(
        model = url,
        contentDescription = contentDescription,
        modifier = modifier,
        contentScale = contentScale,
        placeholder = remember { placeholder },
        error = remember { error },
    )
}

Version 3.0.4

Guia do colaborador