diff --git a/src/org/thoughtcrime/securesms/ConversationItem.java b/src/org/thoughtcrime/securesms/ConversationItem.java index 422a7503e1..28b903ad77 100644 --- a/src/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/ConversationItem.java @@ -166,6 +166,7 @@ public class ConversationItem extends LinearLayout { } public void unbind() { + mediaThumbnail.clear(); } public MessageRecord getMessageRecord() { diff --git a/src/org/thoughtcrime/securesms/components/ThumbnailView.java b/src/org/thoughtcrime/securesms/components/ThumbnailView.java index fa7733b3b1..5668ffef6f 100644 --- a/src/org/thoughtcrime/securesms/components/ThumbnailView.java +++ b/src/org/thoughtcrime/securesms/components/ThumbnailView.java @@ -53,11 +53,6 @@ public class ThumbnailView extends ForegroundImageView { super(context, attrs, defStyle); } - @Override protected void onDetachedFromWindow() { - Glide.clear(this); - super.onDetachedFromWindow(); - } - public void setImageResource(@Nullable MasterSecret masterSecret, long id, long timestamp, @NonNull ListenableFutureTask slideDeckFuture) @@ -97,6 +92,10 @@ public class ThumbnailView extends ForegroundImageView { this.thumbnailClickListener = listener; } + public void clear() { + if (isContextValid()) Glide.clear(this); + } + @TargetApi(VERSION_CODES.JELLY_BEAN_MR1) private boolean isContextValid() { return !(getContext() instanceof Activity) ||