From 7e317c049f25423f46c4651d8d0b476d457ff3c0 Mon Sep 17 00:00:00 2001 From: vlysenkov Date: Thu, 16 Nov 2017 08:09:48 -0800 Subject: [PATCH] Allow Glide's EngineResources to be garbage collected by removing the extra strong reference. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=175964658 --- .../java/com/bumptech/glide/load/engine/ActiveResources.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/bumptech/glide/load/engine/ActiveResources.java b/library/src/main/java/com/bumptech/glide/load/engine/ActiveResources.java index 0cbde46d12..f88316ca8f 100644 --- a/library/src/main/java/com/bumptech/glide/load/engine/ActiveResources.java +++ b/library/src/main/java/com/bumptech/glide/load/engine/ActiveResources.java @@ -83,14 +83,14 @@ public boolean queueIdle() { private static class ResourceWeakReference extends WeakReference> { @Synthetic final Key key; - @Synthetic final EngineResource resource; + @Synthetic final Resource resource; @Synthetic final boolean isCacheable; ResourceWeakReference( Key key, EngineResource r, ReferenceQueue> q) { super(r, q); this.key = Preconditions.checkNotNull(key); - this.resource = Preconditions.checkNotNull(r); + this.resource = Preconditions.checkNotNull(r.getResource()); isCacheable = r.isCacheable(); } }