Commit e79920c
Fix EXC_BAD_ACCESS for animated (facebook#54158)
Summary:
Pull Request resolved: facebook#54158
Changelog: [Internal]
Animated was capturing `self` directly in C++ std::function contexts. When capturing Objective-C objects in C++ lambdas, they aren't automatically retained. When these lambdas were invoked later (potentially after `self` was deallocated), accessing `_onRender` and other instance variables caused the crash.
Reviewed By: zeyap
Differential Revision: D84638972
fbshipit-source-id: 38f8630cf4f677e29afff07348c2d5dbb1f5cd081 parent 094794a commit e79920c
File tree
1 file changed
+20
-11
lines changed- packages/react-native/ReactApple/RCTAnimatedModuleProvider
1 file changed
+20
-11
lines changedLines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | | - | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
0 commit comments