diff --git a/lager/detail/nodes.hpp b/lager/detail/nodes.hpp index 0748259..633be49 100644 --- a/lager/detail/nodes.hpp +++ b/lager/detail/nodes.hpp @@ -235,8 +235,9 @@ class reader_node : public observable_reader_node bool garbage = false; this->observers()(last_); - for (auto& wchild : this->children()) { - if (auto child = wchild.lock()) { + const auto& children = this->children(); + for (size_t i = 0, size = children.size(); i < size; ++i) { + if (auto child = children[i].lock()) { child->notify(); } else { garbage = true;