Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix-FXIOS-8420 Fix for Retain Cycle in all Function for Deferred<T> Aggregation #18669

Conversation

amanjeetsingh150
Copy link
Contributor

@amanjeetsingh150 amanjeetsingh150 commented Feb 10, 2024

馃摐 Tickets

Jira Ticket
Github issue

馃挕 Description

Refactored the original implementation's recursive closure calls that introduced a potential for retain cycles, leading to memory leaks as attached in GitHub issue. The revised approach utilizes a non-recursive helper function, processNext, to process each Deferred object and append its result to an aggregate array. This method ensures that all Deferred objects are processed without retaining strong references that could prevent the Deferred objects and their associated closures from being deallocated.

Verified that no leaks exist after this refactoring. Check the resulting leak dump here which does not have any report referencing paths of ContentBlocker file.

馃摑 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed I updated documentation / comments for complex code and public methods

Copy link
Contributor

mergify bot commented Feb 10, 2024

This pull request has conflicts when rebasing. Could you fix it @amanjeetsingh150? 馃檹

@lmarceau
Copy link
Contributor

Hello, for the reason listed on the task #18668 I'll close this PR. Thank you!

@lmarceau lmarceau closed this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants