Commit 3924768
Fix bitmap reuse race condition in FrameTimingsObserver (#55745)
Summary:
Pull Request resolved: #55745
The shared `bitmapBuffer` could be overwritten by a new `PixelCopy` request on the main thread while a previous frame's encoding coroutine was still reading from it. Each frame now gets its own bitmap, recycled after encoding.
NOTE: This will come at a slight perf cost (allocating extra new bitmaps in memory), for the tradeoff of correctness.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D94368260
fbshipit-source-id: f89f6f4cdd34278ed91d4a673af343999550d9191 parent d552f2a commit 3924768
File tree
1 file changed
+3
-12
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector
1 file changed
+3
-12
lines changedLines changed: 3 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
124 | 120 | | |
125 | 121 | | |
126 | 122 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 123 | + | |
135 | 124 | | |
136 | 125 | | |
137 | 126 | | |
| |||
142 | 131 | | |
143 | 132 | | |
144 | 133 | | |
| 134 | + | |
145 | 135 | | |
146 | 136 | | |
147 | 137 | | |
| |||
169 | 159 | | |
170 | 160 | | |
171 | 161 | | |
| 162 | + | |
172 | 163 | | |
173 | 164 | | |
174 | 165 | | |
| |||
0 commit comments