Open ferhatparmak opened 1 year ago
Thanks for reporting! This looks like a bug to me indeed!
DownloadManager.release()
documents that the manager must not be accessed after this method has been called
. Hence we must make sure that release
cleans up the resources once acquired which includes the RequirementsWatcher
that is created in the constructor (or on setRequirements(Requirements requirements)
being called).
I think we need to call requirementsWatcher.stop()
in DownloadManager.release()
which unregisters the receivers.
When
DownloadManager.release()
is called, it doesn't seem stoppingRequirementsWatcher
which keeps some receivers registered and that would holdDownloadManager
instance. Isn't this a memory leak?Memory profiler after
release()
is called onDownloadManager
: