Skip to content
This repository was archived by the owner on Oct 15, 2018. It is now read-only.
This repository was archived by the owner on Oct 15, 2018. It is now read-only.

Removed bitmaps on LruCache is not checked if it is being used #41

Description

In BitmapMemoryLruCache#getBitmapFromRemoved method, we judge if the bitmap is used by following:
value != null && value.isBitmapValid() && value.isBitmapMutable()
This is not enough and should be added following:
&& !value.isBeingDisplayed() && !value.isReferencedByCache()

This is because LruCache#entryRemoved is not called on the bitmap is no more used but called on the last method call of LruCache#get for the bitmap is in the distant past.

I met this issue when using ListView on ViewPager. When I scrolled ListView enough and changed page, bitmaps on another pages are not correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions