use flecs_ecs::prelude::*;
fn main() {
let world = World::new();
let e = world.entity_named("foo");
let name = e.name();
e.remove_name();
dbg!(name); // You can still use name
_ = vec![vec![b'x'; 3]; 100];
dbg!(name); // This will likely print xxx instead of foo
}
For me this prints:
foo
xxx
Showing that the reference returned by e.name() became dangling.
(Might not be reproducible depending on platform and allocator)
For me this prints:
Showing that the reference returned by
e.name()
became dangling.(Might not be reproducible depending on platform and allocator)