-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory-leaks in LocalCache on iOS, caused by:
1. Retain-cycle between outer LocalCache instance and inner Values, KeySet and EntrySet instances. The use of @weak and @WeakOuter is incorrect there, since inner instances can outlive outer LocalCache instance. The correct solution is to use @RetainedWith annotation to inner-classes. 2. Retain-cycle between ReferenceEntry objects which internally form a doubly-linked list. Fixed by adding @weak annotation to "next" and "previous" links. This is correct, since ReferenceEntry instances are already retained by Segments. The unit test for leak detection is added inside Xplat, because the required testing infrastructure is not present inside "google_common" (the IosAsserts class). Eventually, everything should be moved to "google_common". RELNOTES=Fix memory-leak in LocalCache on iOS ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=325008493
- Loading branch information
Showing
2 changed files
with
72 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.