![]() # Objective Fix the soundness issue outlined in #5866. In short the problem is that `query.to_readonly().get_component_mut::<T>()` can provide unsound mutable access to the component. This PR is an alternative to just removing the offending api. Given that `to_readonly` is a useful tool, I think this approach is a preferable short term solution. Long term I think theres a better solution out there, but we can find that on its own time. ## Solution Add what amounts to a "dirty flag" that marks Queries that have been converted to their read-only variant via `to_readonly` as dirty. When this flag is set to true, `get_component_mut` will fail with an error, preventing the unsound access. |
||
---|---|---|
.. | ||
commands | ||
exclusive_function_system.rs | ||
exclusive_system_param.rs | ||
function_system.rs | ||
mod.rs | ||
query.rs | ||
system_param.rs | ||
system_piping.rs | ||
system.rs |