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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): use WeakRef to prevent object retention in WeakMap #55476

Closed
wants to merge 2 commits into from

Commits on Apr 26, 2024

  1. fix(core): use WeakRef to prevent object retention in WeakMap

    Although keys are not strongly referenced in a `WeakMap`, values are, potentially leading to data retention issues and improper garbage collection. By utilizing `WeakRef`, this problem can be mitigated effectively. Weak references allow the garbage collector to collect an object even if it is only weakly referenced. This can prevent memory leaks in the injector debugger profiler.
    
    Closes angular#55396
    alan-agius4 committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    27ad5f5 View commit details
    Browse the repository at this point in the history
  2. refactor(core): set up framework injector profile exclusively when `W…

    …eakRef` is defined
    
    In some cases in G3 `WeakRef` is undefined because some tests are executed on older unsupported browsers.
    alan-agius4 committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    3aa0b95 View commit details
    Browse the repository at this point in the history