Commit d5595c9
authored
Switch to try_insert in UICameraPropagate (#21519)
# Objective
I've been having panics in situations where:
- I despawn a UI Root Node in PostUpdate
- I don't have any system order dependency between my PostUpdate system
and `UiSystems::Prepare`, so there was no sync point between the two
Therefore the order of operations was:
- My system runs and queues a command to despawn a root node
- The UI system runs and tries to insert `Propagate` on my root node
- CommandExecutions:
- my command to despawn the root node is executed
- the command to insert Propagate is executed, causing a panics
This means that any attempt to despawn a Root node in PostUpdate will
probably cause these kinds of panics.
## Solution
Replace the command with `try_insert` so that if the Root Node is
despawned we don't try to add a Propagate component on it.
## Testing
This fixed the issue in my repo1 parent ea8f22e commit d5595c9
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments