Skip to content

Commit

Permalink
Use the return value of apply when updating RequestManagers' options.
Browse files Browse the repository at this point in the history
If the RequestOptions object has auto clone enabled, apply() will leave the original object unmodified and return a new mutated copy. Right now RequestManage is ignoring the new mutated copy and retaining the old unmodified object which causes Glide to ignore the applied options.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166084541
  • Loading branch information
sjudd committed Aug 25, 2017
1 parent 0312208 commit d717e83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/com/bumptech/glide/RequestManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ public RequestManager(Glide glide, Lifecycle lifecycle, RequestManagerTreeNode t
}

protected void setRequestOptions(@NonNull RequestOptions toSet) {
this.requestOptions = toSet.clone().autoClone();
requestOptions = toSet.clone().autoClone();
}

private void updateRequestOptions(RequestOptions toUpdate) {
this.requestOptions.apply(toUpdate);
requestOptions = requestOptions.apply(toUpdate);
}

/**
Expand Down

0 comments on commit d717e83

Please sign in to comment.