Automatically discard / cancel GeckoResults when view or session are destroyed
Categories
(GeckoView :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: csadilek, Unassigned)
Details
We've recently discovered a memory leak caused by indirectly referencing the activity context in the lambda passed to GeckoResult.then.
This is a very easy mistake to make and simply referencing this in most cases is enough to reference the context. Our concrete case was the capturePixels call on the GeckoView where the callback updated the bitmap of the tab.
We've worked around this by making sure we don't capture this and the context in the callback and use local variables everywhere inside the lambda, but it would be great if GeckoResults were automatically discarded if the corresponding view or session are destroyed.
Since we have GeckoResults on lots of different API calls, a generic solution would be ideal so the embedder doesn't have to worry about managing GeckoResults in response to lifecycle changes.
Updated•5 years ago
|
Description
•