From 56642eba71bb77ba5d19888bcc8697fd9e786c65 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 23 Feb 2015 09:12:01 +0100 Subject: Fix problem in GroupingCondition::remove_child --- src/squelch/condition.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/squelch') diff --git a/src/squelch/condition.cc b/src/squelch/condition.cc index bcaa7ae6..ea2e9e40 100644 --- a/src/squelch/condition.cc +++ b/src/squelch/condition.cc @@ -291,12 +291,14 @@ void GroupingCondition::add_child(ConditionFactory const &factory) void GroupingCondition::remove_child(Condition *condition) { - std::remove_if( - std::begin(m_conditions), - std::end(m_conditions), - [&] (std::shared_ptr p) { - return p.get() == condition; - }); + m_conditions.erase( + std::remove_if( + std::begin(m_conditions), + std::end(m_conditions), + [&] (std::shared_ptr p) { + return p.get() == condition; + }), + std::end(m_conditions)); } std::shared_ptr GroupingCondition::first_child() -- cgit v1.2.3