From d4e36958f851000be58c427517fbf65aee68bd84 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 21 May 2018 20:07:25 +1000 Subject: [PATCH] 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. --- src/buffer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/buffer.cc b/src/buffer.cc index d82b4627..3b636734 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -127,7 +127,9 @@ void Buffer::on_registered() } } - for (auto& option : options().flatten_options()) + for (auto& option : options().flatten_options() + | transform(&std::unique_ptr