Fix wrong increment of deleted iterator.
This fixes the invalid access spotted by valgrind.
This commit is contained in:
parent
09b41f6d0c
commit
09299595fe
1 changed files with 2 additions and 1 deletions
|
@ -140,8 +140,9 @@ namespace cloonel {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void ObserversManager<T>::RemoveAll() noexcept {
|
void ObserversManager<T>::RemoveAll() noexcept {
|
||||||
if (not m_tree.empty()) {
|
if (not m_tree.empty()) {
|
||||||
for (typename TreeType::sibling_iterator it(m_tree.begin()), itEND(m_tree.end()); it != itEND; ++it) {
|
for (typename TreeType::sibling_iterator it(m_tree.begin()), itEND(m_tree.end()); it != itEND;) {
|
||||||
const TicketType ticket = it->ticket;
|
const TicketType ticket = it->ticket;
|
||||||
|
++it;
|
||||||
this->Remove(ticket);
|
this->Remove(ticket);
|
||||||
}
|
}
|
||||||
assert(m_tree.empty());
|
assert(m_tree.empty());
|
||||||
|
|
Loading…
Reference in a new issue