diff options
| author | 2024-10-03 22:50:47 +0000 | |
|---|---|---|
| committer | 2024-10-03 22:50:47 +0000 | |
| commit | 1b2bca67c50741cb560f491c24764573ac5f2625 (patch) | |
| tree | 045077d2b7f619836e8eb1ee228e8f1a1e45c5d0 /ravenwood/scripts/convert-androidtest.py | |
| parent | 53aebb03325b85ddaeb76ff3e71593b2097e8274 (diff) | |
Optimize the removal of garbage collected references to avoid memory leaks
mAllResourceReferences collects weak references to a resource when it is constructed, which is used to update the resource path of the library when loading webview. Currently, its garbage collected references(mAllResourceReferencesQueue) only cleaned up when ResourcesManager#redirectAllResourcesToNewImplLocked is executed, which means that if the application does not rely on webview, then cleanup cannot be performed.
Therefore, we need to clean up the mAllResourceReferencesQueue once when creating a new Resource and preparing to add its weak reference to mAllResourceReferences.
Bug: 363887630
Test: Create multiple new resources in app and observe mAllResourceReferencesQueue
Signed-off-by: zhangshuai10 <zhangshuai10@xiaomi.corp-partner.google.com>
(cherry picked from https://partner-android-review.googlesource.com/q/commit:d64e23dcff6acee2b8dd57a047389172fe95054e)
Merged-In: Ide10752f2dce86ff9b7d16335e625ae1919255f3
Change-Id: Ide10752f2dce86ff9b7d16335e625ae1919255f3
Diffstat (limited to 'ravenwood/scripts/convert-androidtest.py')
0 files changed, 0 insertions, 0 deletions