summaryrefslogtreecommitdiff
path: root/src/squelch
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:12:01 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:12:01 +0100
commit56642eba71bb77ba5d19888bcc8697fd9e786c65 (patch)
treebae4d3ca01e308233dec67d7e8a894bbddc5cefd /src/squelch
parentaba7dbda30fcc8be0fe129f065ce3e494b374c54 (diff)
Fix problem in GroupingCondition::remove_child
Diffstat (limited to 'src/squelch')
-rw-r--r--src/squelch/condition.cc14
1 files changed, 8 insertions, 6 deletions
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<Condition> p) {
- return p.get() == condition;
- });
+ m_conditions.erase(
+ std::remove_if(
+ std::begin(m_conditions),
+ std::end(m_conditions),
+ [&] (std::shared_ptr<Condition> p) {
+ return p.get() == condition;
+ }),
+ std::end(m_conditions));
}
std::shared_ptr<Condition> GroupingCondition::first_child()