summaryrefslogtreecommitdiffstats
path: root/src/composite-undo-stack-observer.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/composite-undo-stack-observer.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp
index 383e08cd8..81a0b27c7 100644
--- a/src/composite-undo-stack-observer.cpp
+++ b/src/composite-undo-stack-observer.cpp
@@ -137,16 +137,22 @@ CompositeUndoStackObserver::_unlock()
if (!--this->_iterating) {
// Remove marked observers
UndoObserverRecordList::iterator i = this->_active.begin();
- for(; i != this->_active.begin(); ++i) {
+ for(; i != this->_active.begin(); ) {
if (i->to_remove) {
- this->_active.erase(i);
+ i = this->_active.erase(i);
+ }
+ else{
+ ++i;
}
}
i = this->_pending.begin();
- for(; i != this->_pending.begin(); ++i) {
+ for(; i != this->_pending.begin(); ) {
if (i->to_remove) {
- this->_active.erase(i);
+ i = this->_active.erase(i);
+ }
+ else {
+ ++i;
}
}