makspll / bevy_mod_scripting

Bevy Scripting Plugin
Apache License 2.0
390 stars 31 forks source link

guard the WorldPointer against UB #83

Closed jrobsonchase closed 10 months ago

jrobsonchase commented 10 months ago

Resolves #82

Prevents WorldPointers from seeing an invalid *mut World by wrapping it in an Option that gets taken when the original WorldPointerGuard gets dropped.

Also adding a couple of blocking variants of the existing read/write methods since I'm not in love with the current panic-rather-than-block semantics. I would probably advocate for inverting them and block by default, but I didn't want to shake things up too much.