Commit 081a3f3a authored by Bernhard Bauer's avatar Bernhard Bauer Committed by Commit Bot

Clear suggestion member when recycling a SuggestionsBinder.

Bug: 718925
Change-Id: Icf37ad3a7f6ace1869b9d17721960e6c844b0b88
Reviewed-on: https://chromium-review.googlesource.com/576093Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487511}
parent 4af07e74
...@@ -362,7 +362,10 @@ public class SuggestionsBinder { ...@@ -362,7 +362,10 @@ public class SuggestionsBinder {
// This approach allows us to save the thumbnail in its corresponding SnippetArticle // This approach allows us to save the thumbnail in its corresponding SnippetArticle
// regardless of whether a new suggestion has been bound to the view holder. This way we // regardless of whether a new suggestion has been bound to the view holder. This way we
// don't have to cancel fetches and can use the retrieved thumbnail later on. // don't have to cancel fetches and can use the retrieved thumbnail later on.
if (!TextUtils.equals(mCapturedSuggestion.getUrl(), mSuggestion.getUrl())) return; if (mSuggestion == null
|| !TextUtils.equals(mCapturedSuggestion.getUrl(), mSuggestion.getUrl())) {
return;
}
fadeThumbnailIn(thumbnail); fadeThumbnailIn(thumbnail);
} }
...@@ -376,5 +379,7 @@ public class SuggestionsBinder { ...@@ -376,5 +379,7 @@ public class SuggestionsBinder {
// Clear the thumbnail and favicon drawables to allow the bitmap memory to be reclaimed. // Clear the thumbnail and favicon drawables to allow the bitmap memory to be reclaimed.
mThumbnailView.setImageDrawable(null); mThumbnailView.setImageDrawable(null);
mPublisherTextView.setCompoundDrawables(null, null, null, null); mPublisherTextView.setCompoundDrawables(null, null, null, null);
mSuggestion = null;
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment