Gather options in a vector when running Buffer::on_option_changed

on_option_changed might trigger hooks that will mutate the option
managers, invalidating the iterators we use.
This commit is contained in:
Maxime Coste 2018-05-21 20:07:25 +10:00
parent 919b7ce645
commit d4e36958f8

View File

@ -127,7 +127,9 @@ void Buffer::on_registered()
} }
} }
for (auto& option : options().flatten_options()) for (auto& option : options().flatten_options()
| transform(&std::unique_ptr<Option>::get)
| gather<Vector<Option*>>())
on_option_changed(*option); on_option_changed(*option);
} }