mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-27 06:55:15 -04:00
Fixed the memory leak in LocalFileTransferFragment.
* The issue is inside the library, they forgotten to detach the view after its successful use, means when the showCase is shown they are not detaching the view from window which causing the memory leak. They have not mentioned this step into their documentation to address the memory leak.
This commit is contained in:
parent
5e2c314f74
commit
2ff2387876
@ -195,6 +195,15 @@ class LocalFileTransferFragment :
|
||||
getString(R.string.transfer_zim_files_list_message),
|
||||
getString(R.string.got_it)
|
||||
)
|
||||
setOnItemDismissedListener { showcaseView, _ ->
|
||||
// To fix the memory leak by setting setTarget to null
|
||||
// because the memory leak occurred inside the library.
|
||||
// They had forgotten to detach the view after its successful use,
|
||||
// so it holds the reference of these views in memory.
|
||||
// By setting these views as null we remove the reference from
|
||||
// the memory after they are successfully shown.
|
||||
showcaseView.setTarget(null)
|
||||
}
|
||||
start()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user