summaryrefslogtreecommitdiffstats
path: root/src/composite-undo-stack-observer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/composite-undo-stack-observer.cpp')
-rw-r--r--src/composite-undo-stack-observer.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp
index 03e4796bd..81a0b27c7 100644
--- a/src/composite-undo-stack-observer.cpp
+++ b/src/composite-undo-stack-observer.cpp
@@ -1,6 +1,4 @@
-/**
- * Aggregates undo stack observers for convenient management and triggering in SPDocument
- *
+/*
* Heavily inspired by Inkscape::XML::CompositeNodeObserver.
*
* Authors:
@@ -139,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;
}
}