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 FpsDebugFrameCallback so that we properly cancel frame loop to avoid race (#38671)
Summary:
Pull Request resolved: #38671
Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the `mShouldStop` flag, causing the old frame loop continues to run unexpectedly.
The fix here guarantees `stop` would queue logic that removes the frame loop callback, and a later `start` would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync.
Changelog:
[Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback.
Reviewed By: hoxyq
Differential Revision: D47849848
fbshipit-source-id: 8c4be40e86be128734bfa3f571fd3a1735976c7c
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.java
0 commit comments