VOOZH about

URL: https://phabricator.services.mozilla.com/D306748

⇱ ⚙ D306748 Bug 2041351 - Don't leak addon icon coroutines on a long-lived scope r=#android-reviewers


Bug 2041351 - Don't leak addon icon coroutines on a long-lived scope r=#android-reviewers
ClosedPublic

Authored by petru on Mon, Jun 15, 1:27 PM.

Details

Summary

AMOAddonsProvider launched icon fetches in a CoroutineScope that never
gets cancelled. Because the deferreds are awaited via awaitAll(), their
completion handlers retained the caller's continuation, keeping
short-lived callers (e.g. MenuDialogFragment) alive long after they were
destroyed.
Loading the icons within a coroutineScope() instead will ensure the fetches
are children of the calling coroutine and are cancelled with it, rather
than being orphaned on a scope reachable from GlobalAddonDependencyProvider.

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
This revision is now accepted and ready to land.Mon, Jun 15, 2:10 PM
This revision is now accepted and ready to land.Tue, Jun 16, 8:34 AM

Revision Contents

PathSize
mobile/
android/
android-components/
components/
feature/
addons/
src/
main/
java/
mozilla/
components/
feature/
addons/
amo/
24 lines
test/
java/
mozilla/
components/
feature/
addons/
amo/
12 lines
CommitTreeParentsAuthorSummaryDate
97ba449c267ac6318f9b6d65Mugurell
Bug 2041351 - Don't leak addon icon coroutines on a long-lived scope r=android… (Show More…)

Diff 1300998

mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/amo/AMOAddonsProvider.kt

Loading...

mobile/android/android-components/components/feature/addons/src/test/java/mozilla/components/feature/addons/amo/AMOAddonsProviderTest.kt

Loading...