diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2011-11-05 07:20:36 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2011-11-05 07:20:36 +0000 |
| commit | 7b1b14913ac759e86176d212afa6d90f67eb8bb6 (patch) | |
| tree | 6c76923a97854c7ae6c24ee4e352e4b413d9a909 /src/composite-undo-stack-observer.cpp | |
| parent | 1) Cycle to the next-closest-snap-source when pressing tab, if the snap-close... (diff) | |
| download | inkscape-7b1b14913ac759e86176d212afa6d90f67eb8bb6.tar.gz inkscape-7b1b14913ac759e86176d212afa6d90f67eb8bb6.zip | |
Various fixes: initialization, memory leak, wrong iterator usage
(bzr r10721)
Diffstat (limited to 'src/composite-undo-stack-observer.cpp')
| -rw-r--r-- | src/composite-undo-stack-observer.cpp | 14 |
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; } } |
