You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Break circular reference in NativeProxy and AndroidUIScheduler (#6697)
## Summary
Breaks circular reference in `NativeProxy` and `AndroidUIScheduler`.
Needs
#6671 to
work.
`NativeProxy` and `AndroidUIScheduler` is a `HybridClass` with a C++
counterpart holding a global reference to the Java object. This
structure creates a circular reference between C++ and Java, which the
garbage collector cannot clean up. To resolve this issue, I manually
removed the reference between C++ and Java by resetting the global ref
during the invalidation of the `NativeProxy` and `AndroidUIScheduler`.
## Test plan
I tested it with a new project using Expo (SDK 52) and with Fabric
enabled. I reloaded the app several times and performed a heap dump to
verify that everything was removed correctly.
---------
Co-authored-by: Tomasz Żelawski <tzelawski@gmail.com>
Co-authored-by: Krzysztof Piaskowy <krzysztof.piaskowy@swmansion.com>
Co-authored-by: Tomek Zawadzki <tomekzawadzki98@gmail.com>
0 commit comments