cardslib icon indicating copy to clipboard operation
cardslib copied to clipboard

CardThumbnailView memory leak

Open shayousefi opened this issue 9 years ago • 2 comments

Here's the leak trace:

* GC ROOT static it.gmariotti.cardslib.library.utils.CacheUtil.sInstance
* references it.gmariotti.cardslib.library.utils.CacheUtil.mMemoryCache
* references it.gmariotti.cardslib.library.view.component.CardThumbnailView$1.this$0
(anonymous class extends android.util.LruCache)
* references it.gmariotti.cardslib.library.view.component.CardThumbnailView.mContext
* leaks ...activities.NowActivity instance

It seems like this is caused by the anonymous, inner class being non-static.

shayousefi avatar May 26 '15 14:05 shayousefi

I can confirm this bug. Can also provide logs or more informations if needed.

ChristopheVersieux avatar Jun 02 '15 04:06 ChristopheVersieux

Can also confirm. Using CacheUtil.putMemoryCache(null); after removing card views from layout can be used a temp fix for the leak. (If you were to do this in onDestroy, it has to be before calling super.onDestroy();)

jamesacres avatar Apr 12 '16 12:04 jamesacres