Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_parent segfaults when used from within systems #473

Closed
Hexlord opened this issue Aug 15, 2021 · 1 comment
Closed

get_parent segfaults when used from within systems #473

Hexlord opened this issue Aug 15, 2021 · 1 comment
Labels
bug Something isn't working
Projects

Comments

@Hexlord
Copy link
Contributor

Hexlord commented Aug 15, 2021

Describe the bug
Attempt to get parent of an entity within system iterator segfault crashes.

To Reproduce

auto ECS = flecs::world();
struct Comp {int Field;};
auto E1 = ECS.entity();
auto E2 = ECS.entity().child_of(E1).add<Comp>();
ECS.system("System name", "[in] Comp").iter([](iter &Iter) {
    for (auto Index : Iter) {
        entity Entity = Iter.entity(Index);
        entity_view Parent = Entity.get_parent(0);
    }
});
ECS.progress(1.0f);
ECS.progress(1.0f);
ECS.progress(1.0f);
ECS.progress(1.0f);

Expected behavior
No crash happens

Additional information
Bug introduced in this commit: 8b24d0d

@Hexlord Hexlord added the bug Something isn't working label Aug 15, 2021
@SanderMertens
Copy link
Owner

Fixed!

@SanderMertens SanderMertens added this to To do in v3 via automation Oct 1, 2021
@SanderMertens SanderMertens moved this from To do to Done in v3 Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
v3
  
Done
Development

No branches or pull requests

2 participants