diff options
| author | Torbjörn Andersson | 2009-09-29 19:51:37 +0000 | 
|---|---|---|
| committer | Torbjörn Andersson | 2009-09-29 19:51:37 +0000 | 
| commit | c85736913140a8c65aed7060a4ae2cc4a64bee70 (patch) | |
| tree | a595e9bbed032a79b0c820de9aef6e691ad6eedd | |
| parent | f6aaafae7c602311a65838f4b798e7a536057ea7 (diff) | |
| download | scummvm-rg350-c85736913140a8c65aed7060a4ae2cc4a64bee70.tar.gz scummvm-rg350-c85736913140a8c65aed7060a4ae2cc4a64bee70.tar.bz2 scummvm-rg350-c85736913140a8c65aed7060a4ae2cc4a64bee70.zip | |
Fixed Valgrind warnings about invalid memory access. Hopefully without breaking
anything, but modifying a data structure while traversing it can be a bit
tricky...
svn-id: r44469
| -rw-r--r-- | engines/draci/animation.cpp | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index 01bd9b93a5..90dc7fdf9d 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -449,7 +449,7 @@ void AnimationManager::sortAnimations() {  			if ((*next)->getZ() < (*cur)->getZ()) {  				Animation *anim = *next; -				_animations.erase(next); +				next = _animations.reverse_erase(next);  				insertAnimation(anim);  				hasChanged = true; @@ -502,7 +502,7 @@ void AnimationManager::deleteOverlays() {  	for (it = _animations.begin(); it != _animations.end(); ++it) {  		if ((*it)->getID() == kOverlayImage) {  			delete *it; -			_animations.erase(it); +			it = _animations.reverse_erase(it);  		}	  	}  } @@ -536,7 +536,7 @@ void AnimationManager::deleteAfterIndex(int index) {  			debugC(3, kDraciAnimationDebugLevel, "Deleting animation %d...", (*it)->getID());  			delete *it; -			_animations.erase(it); +			it = _animations.reverse_erase(it);  		}  	} | 
