Skip to content

Remove dangling pointers after removing brushes#8

Open
tomc1998 wants to merge 1 commit intolaleksic:masterfrom
tomc1998:fix-brush-dangling-ptr
Open

Remove dangling pointers after removing brushes#8
tomc1998 wants to merge 1 commit intolaleksic:masterfrom
tomc1998:fix-brush-dangling-ptr

Conversation

@tomc1998
Copy link

This fixes a crash that can be caused by e.g.

auto brush = world->add();
// Adds brush pointer to world_t::need_fragment_rebuild
brush->set_time(brush->get_time());
world->remove(brush);
world->rebuild(); // Accesses dangling brush_t ptr

It also makes brush removal trigger a rebuild for intersecting brushes, which it didn't previously

This fixes a crash that can be caused by e.g.

auto brush = world->add();
// Adds brush pointer to world_t::need_fragment_rebuild
brush->set_time(brush->get_time());
world->remove(brush);
world->rebuild(); // Accesses dangling brush_t ptr

It also makes brush removal trigger a rebuild for intersecting brushes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant