Merge pull request #594 from LuisAntonRebollo/unit-tests-without-crash

Increased stability Torque3D: unit-tests running without a crash.
This commit is contained in:
Daniel Buckmaster 2014-06-16 10:57:04 +10:00
commit feec36731e
18 changed files with 113 additions and 19 deletions

View file

@ -686,7 +686,8 @@ void SFXSystem::_onRemoveSource( SFXSource* source )
if( dynamic_cast< SFXSound* >( source ) )
{
SFXSoundVector::iterator iter = find( mSounds.begin(), mSounds.end(), static_cast< SFXSound* >( source ) );
mSounds.erase_fast( iter );
if( iter != mSounds.end() )
mSounds.erase_fast( iter );
mStatNumSounds = mSounds.size();
}