mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Fix crash when attempting to clear pending GlideImage loads.
Hold a reference to the Glide RequestManager instead of creating a new instance when attempting to clear pending loads and free resources for the target.
This commit is contained in:
committed by
Alex Hart
parent
e6ca41c0f9
commit
a88394ffe4
@@ -114,7 +114,8 @@ private fun <T> GlideImage(
|
||||
val density = LocalDensity.current
|
||||
val context = LocalContext.current
|
||||
DisposableEffect(model, fallback, error, diskCacheStrategy, density, imageSize) {
|
||||
val builder = Glide.with(context)
|
||||
val requestManager = Glide.with(context)
|
||||
val builder = requestManager
|
||||
.load(model)
|
||||
.fallback(fallback)
|
||||
.error(error)
|
||||
@@ -134,7 +135,7 @@ private fun <T> GlideImage(
|
||||
|
||||
object : DisposableEffectResult {
|
||||
override fun dispose() {
|
||||
Glide.with(context).clear(target)
|
||||
requestManager.clear(target)
|
||||
drawable = null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user