Skip to content

Commit

Permalink
Allow Glide's EngineResources to be garbage collected by removing the…
Browse files Browse the repository at this point in the history
… extra strong reference.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175964658
  • Loading branch information
xopok authored and sjudd committed Nov 16, 2017
1 parent f24ba47 commit 7e317c0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ public boolean queueIdle() {

private static class ResourceWeakReference extends WeakReference<EngineResource<?>> {
@Synthetic final Key key;
@Synthetic final EngineResource<?> resource;
@Synthetic final Resource<?> resource;
@Synthetic final boolean isCacheable;

ResourceWeakReference(
Key key, EngineResource<?> r, ReferenceQueue<? super EngineResource<?>> q) {
super(r, q);
this.key = Preconditions.checkNotNull(key);
this.resource = Preconditions.checkNotNull(r);
this.resource = Preconditions.checkNotNull(r.getResource());
isCacheable = r.isCacheable();
}
}
Expand Down

0 comments on commit 7e317c0

Please sign in to comment.