Skip to content

MuonTesterTree: Fix use-after-free error.

In MuonTesterTree, m_branches_to_init must be listed before m_branches. When m_branches is destroyed, the branches being deleted will try to remove themselves from m_branches_to_init. If these are in the opposite order, then m_branches_to_init will already have been destroyed, and we'll be accessing freed memory.

Fixes crash seen during genconf in some builds of MuonGeoModelTest.

Also rewrite Remove() to use remove_if.

Merge request reports