Repository navigation
Commit 779e79f
Initialize module-class registry in RCTGetModuleClasses
Summary:
`RCTModuleClasses` and `RCTModuleClassesSyncQueue` were only created inside `RCTRegisterModule`. When `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` is defined, `RCTViewManager` is no longer registered through `RCTRegisterModule`, so an app with no other legacy modules registered this way never creates the queue. `RCTGetModuleClasses()` then calls `dispatch_sync(NULL, ...)` during `RCTHost` start and crashes with SIGSEGV.
This moves the one-time initialization into `RCTEnsureModuleClassesRegistry()`, which both `RCTGetModuleClasses` and `RCTRegisterModule` call. With no registered modules, `RCTGetModuleClasses` now returns an empty array.
No visible UI change.
## Changelog:
[iOS][Fixed] - Fix crash in `RCTGetModuleClasses` when no legacy modules have been registered (e.g. with `RCT_REMOVE_LEGACY_COMPONENT_INTEROP`)
Differential Revision: D1327882741 parent 22af4c7 commit 779e79f
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
33 | 46 | | |
34 | 47 | | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
| |||
141 | 155 | | |
142 | 156 | | |
143 | 157 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| |||
0 commit comments